* Store enhancer that adds methods to the store.
()
| 95 | * Store enhancer that adds methods to the store. |
| 96 | */ |
| 97 | function extraMethods() { |
| 98 | const enhancer: StoreEnhancer<{ method(): string }> = |
| 99 | createStore => |
| 100 | (...args) => { |
| 101 | const store = createStore(...args) |
| 102 | return { |
| 103 | ...store, |
| 104 | method: () => 'foo' |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | const store = createStore(reducer, enhancer) |
| 109 | |
| 110 | store.getState() |
| 111 | const res: string = store.method() |
| 112 | // @ts-expect-error |
| 113 | store.wrongMethod() |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * replaceReducer with a store enhancer |
nothing calls this directly
no test coverage detected