[]
        
(Showing Draft Content)

GC.Spread.Common.UserManager

クラス: UserManager

Spread.Common.UserManager

Table of contents

コンストラクタ

メソッド

コンストラクタ

constructor

new UserManager()

ユーザーマネージャーを表します。

メソッド

bind

Static bind(event, handler): void

イベントハンドラーをバインドします。

静的

実例

GC.Spread.Common.UserManager.bind(GC.Spread.Common.Events.CurrentUserChanged, (event, args) => {
    console.log(event);
    console.log(args.oldCurrentUser);
    console.log(args.newCurrentUser);
});

パラメータ

名前 説明
event Events イベントタイプ。
handler Function イベントハンドラ。

戻り値

void


configure

Static configure(options): void

ユーザーマネージャーオプションを設定します。

静的

パラメータ

名前 説明
options IUserManagerOptions ユーザマネージャのオプション。

戻り値

void


current

Static current(userId?): undefined | string

現在のユーザーを取得または設定します。

静的

実例

//ログインページから移動し、ログインユーザIDを取得します。
spread.users.current('715CFB19-2BB9-4B94-BE0C-08D0F9A019D4'); // { id: "715CFB19-2BB9-4B94-BE0C-08D0F9A019D4", name: "John Doe" }
console.log(spread.users.getSync(spread.users.current()).name); // "John Doe"

パラメータ

名前
userId? string

戻り値

undefined | string

現在のユーザID。


get

Static get(userId): Promise<undefined | IUser>

ユーザIDでユーザを取得します。

静的

パラメータ

名前 説明
userId string ユーザID。

戻り値

Promise<undefined | IUser>

ユーザ。


unbind

Static unbind(event, handler): void

イベントハンドラのバインドを解除します。

静的

パラメータ

名前 説明
event Events イベントタイプ。
handler Function イベントハンドラ。

戻り値

void