| 15 | dispatch: PromiseDispatch |
| 16 | }> = |
| 17 | createStore => |
| 18 | <S, A extends Action, PreloadedState>( |
| 19 | reducer: Reducer<S, A, PreloadedState>, |
| 20 | preloadedState?: PreloadedState | undefined |
| 21 | ) => { |
| 22 | const store = createStore(reducer, preloadedState) |
| 23 | return { |
| 24 | ...store, |
| 25 | dispatch: (action: any) => { |
| 26 | if (action.type) { |
| 27 | store.dispatch(action) |
| 28 | } else if (action.then) { |
| 29 | action.then(store.dispatch) |
| 30 | } |
| 31 | return action |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | const store = createStore(reducer, enhancer) |
| 37 |
nothing calls this directly
no test coverage detected