first bits of redux

This commit is contained in:
41666 2019-03-20 09:25:28 -05:00
parent 9c7f7fda73
commit def2b0d2a3
13 changed files with 170 additions and 16 deletions

View file

@ -1,7 +1,7 @@
// @flow
import * as React from 'react'
import dynamic from 'next/dynamic'
import { type User } from './user'
import { type User } from '../stores/user'
type Props = {
user: ?User

View file

@ -1,32 +0,0 @@
// @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) => {
}