(
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
initialState: any,
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
handlers: { [type: string]: (state: any, action: any) => any },
)
| 3 | import { create } from "mutative"; |
| 4 | |
| 5 | export const createReducer = ( |
| 6 | // TODO: Fix this the next time the file is edited |
| 7 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 8 | initialState: any, |
| 9 | // TODO: Fix this the next time the file is edited |
| 10 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 11 | handlers: { [type: string]: (state: any, action: any) => any }, |
| 12 | ) => { |
| 13 | // TODO: Fix this the next time the file is edited |
| 14 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 15 | return function reducer(state = initialState, action: ReduxAction<any>) { |
| 16 | if (handlers.hasOwnProperty(action.type)) { |
| 17 | return handlers[action.type](state, action); |
| 18 | } else { |
| 19 | return state; |
| 20 | } |
| 21 | }; |
| 22 | }; |
| 23 | |
| 24 | export const createImmerReducer = ( |
| 25 | // TODO: Fix this the next time the file is edited |
no outgoing calls
no test coverage detected