mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
32 lines
550 B
JavaScript
32 lines
550 B
JavaScript
// @flow
|
|
import { namespaceConfig } from 'fast-redux'
|
|
|
|
export type User = {
|
|
id: string,
|
|
username: string,
|
|
discriminator: string,
|
|
avatar: string,
|
|
nicknameCache: {
|
|
[server: string]: string
|
|
}
|
|
}
|
|
|
|
export type UserState = {
|
|
currentUser: User | null,
|
|
userCache: {
|
|
[id: string]: User
|
|
}
|
|
}
|
|
|
|
const DEFAULT_STATE: UserState = {
|
|
currentUser: null,
|
|
userCache: {}
|
|
}
|
|
|
|
export const {
|
|
action, getState: getUserStore
|
|
} = namespaceConfig('userStore', DEFAULT_STATE)
|
|
|
|
export const getCurrentUser = () => async (dispatch: Function) => {
|
|
|
|
}
|