-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert remaining identifier javascript code to typescript
Convert remaining identifier javascript code to typescript and add all possible type notations as installation packages.
- Loading branch information
Showing
11 changed files
with
104 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
9 changes: 5 additions & 4 deletions
9
identifier/src/actions/utils.js → identifier/src/actions/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
identifier/src/models/hello.js → identifier/src/models/hello.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createStore, applyMiddleware, compose, Middleware, AnyAction, Action, Dispatch } from 'redux'; | ||
import thunkMiddleware, { ThunkAction, ThunkDispatch, ThunkMiddleware } from 'redux-thunk'; | ||
import { createLogger } from 'redux-logger'; | ||
|
||
import rootReducer from './reducers'; | ||
|
||
declare global { | ||
interface Window { | ||
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose; | ||
} | ||
} | ||
|
||
const middlewares: (Middleware<{}, any, any> | (ThunkMiddleware<any, AnyAction, undefined> & { withExtraArgument<ExtraThunkArg, State = any, BasicAction extends Action<any> = AnyAction>(extraArgument: ExtraThunkArg): ThunkMiddleware<any>; }))[] = [ | ||
thunkMiddleware | ||
]; | ||
|
||
if (process.env.NODE_ENV !== 'development') { // eslint-disable-line no-undef | ||
middlewares.push(createLogger()); // must be last middleware in the chain. | ||
} | ||
|
||
const composeEnhancers = (window['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'] as typeof compose) || compose || compose; | ||
|
||
const store = createStore( | ||
rootReducer, | ||
composeEnhancers(applyMiddleware( | ||
...middlewares, | ||
)) | ||
); | ||
|
||
export type RootState = ReturnType<typeof store.getState> | ||
export type AppDispatch = typeof store.dispatch; | ||
export type PromiseDispatch = ThunkDispatch<RootState, any, Action>; | ||
|
||
export default store; |