[]
• new UserManager()
ユーザーマネージャーを表します。
▸ 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
▸ Static configure(options): void
ユーザーマネージャーオプションを設定します。
静的
| 名前 | 型 | 説明 |
|---|---|---|
options |
IUserManagerOptions |
ユーザマネージャのオプション。 |
void
▸ 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。
▸ Static get(userId): Promise<undefined | IUser>
ユーザIDでユーザを取得します。
静的
| 名前 | 型 | 説明 |
|---|---|---|
userId |
string |
ユーザID。 |
Promise<undefined | IUser>
ユーザ。
▸ Static unbind(event, handler): void
イベントハンドラのバインドを解除します。
静的
| 名前 | 型 | 説明 |
|---|---|---|
event |
Events |
イベントタイプ。 |
handler |
Function |
イベントハンドラ。 |
void