flowtyped everything, some functional, safety, and structural changes

This commit is contained in:
41666 2019-03-10 03:18:11 -05:00
parent 6f3eca7a64
commit d2aecb38ca
92 changed files with 17554 additions and 1440 deletions

View file

@ -0,0 +1,30 @@
// @flow
import * as React from 'react'
import dynamic from 'next/dynamic'
import { withRedux } from '../config/redux'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { namespaceConfig } from 'fast-redux'
import * as User from './user'
type Props = {
user: User.User
}
const HeaderBarAuth = dynamic(() => import('../components/header/auth'))
const HeaderBarUnauth = dynamic(() => import('../components/header/unauth'))
const HeaderBar: React.StatelessFunctionalComponent<Props> = () => {
// if ()
return null
}
const mapStateToProps = (state): Props => {
return {}
}
function mapDispatchToProps (dispatch) {
return bindActionCreators({ }, dispatch)
}
export default withRedux(connect(mapStateToProps, mapDispatchToProps)(HeaderBar))

32
UI/containers/user.js Normal file
View file

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