This file contains hidden or 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
| import {Action, ActionCreator, Dispatch} from 'redux'; | |
| import {ThunkAction} from 'redux-thunk'; | |
| // Redux action | |
| const reduxAction: ActionCreator<Action> = (text: string) => { | |
| return { | |
| type: SET_TEXT, | |
| text | |
| }; | |
| }; |
This file contains hidden or 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
| import { ActionCreator } from 'redux' | |
| import { ThunkAction } from 'redux-thunk' | |
| import { WebService } from 'app/services/WebService' | |
| // Create this reusable type that can be imported into your redux action files | |
| export type ThunkResult<R> = ThunkAction<R, RootState, Services, RootAction> | |
| // Services are only necesarry because we are using | |
| // `reduxThunk.withExtraArgument({ webService }))` when we are creating our store. | |
| export type Services = { |
This file contains hidden or 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
| { | |
| "parser": "@typescript-eslint/parser", | |
| "parserOptions": { | |
| "project": "./tsconfig.json", | |
| "tsconfigRootDir": "." | |
| }, | |
| "env": { | |
| "browser": true, | |
| "jest/globals": true | |
| }, |