diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-01-06 12:11:05 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-01-06 12:11:05 +0100 |
commit | 95041dffbd23fe81802efd5fb25cffe492cdb551 (patch) | |
tree | cb66d325fb5d16d8b7fa0f14c91ad17dd4ff7c6c /src/client/react/users.ts | |
parent | 4ca30295d7d9f3dd7ba2e105952ff627f6b702a4 (diff) |
Revert "Add strict typing"
This reverts commit 4ca30295d7d9f3dd7ba2e105952ff627f6b702a4.
Diffstat (limited to 'src/client/react/users.ts')
-rw-r--r-- | src/client/react/users.ts | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/client/react/users.ts b/src/client/react/users.ts index a16e40f..a80a1c5 100644 --- a/src/client/react/users.ts +++ b/src/client/react/users.ts @@ -1,9 +1,6 @@ /* global USERS */ import { combineReducers, createStore } from 'redux'; -import { AnyAction } from 'redux'; -import { Reducer } from 'redux'; -import { ReducersMapObject } from 'redux'; export interface User { type: string, @@ -24,11 +21,7 @@ declare global { const getId = ({ type, value }: User) => `${type}/${value}`; -type ByIdState = { - [userId: string]: User, -} - -const byId = (state: ByIdState = {}, action: Action): ByIdState => { +const byId = (state = {}, action: Action) => { switch (action.type) { case 'USERS/ADD_USER': return { @@ -42,9 +35,7 @@ const byId = (state: ByIdState = {}, action: Action): ByIdState => { } }; -type AllIdsState = string[] - -const allIds = (state: AllIdsState = [], action: Action): AllIdsState => { +const allIds = (state : any[] = [], action : Action) => { switch (action.type) { case 'USERS/ADD_USER': return [ @@ -56,9 +47,7 @@ const allIds = (state: AllIdsState = [], action: Action): AllIdsState => { } }; -type AllUsersState = User[]; - -const allUsers = (state: AllUsersState = [], action: Action): AllUsersState => { +const allUsers = (state : any[] = [], action : Action) => { switch (action.type) { case 'USERS/ADD_USER': return [ @@ -73,9 +62,9 @@ const allUsers = (state: AllUsersState = [], action: Action): AllUsersState => { }; interface State { - byId: ByIdState, - allIds: AllIdsState, - allUsers: AllUsersState, + byId: any, + allIds: string[], + allUsers: User[] } const store = createStore(combineReducers<State>({ |