(reducer, initialArg, init)
| 15149 | } |
| 15150 | |
| 15151 | function mountReducer(reducer, initialArg, init) { |
| 15152 | var hook = mountWorkInProgressHook(); |
| 15153 | var initialState; |
| 15154 | |
| 15155 | if (init !== undefined) { |
| 15156 | initialState = init(initialArg); |
| 15157 | } else { |
| 15158 | initialState = initialArg; |
| 15159 | } |
| 15160 | |
| 15161 | hook.memoizedState = hook.baseState = initialState; |
| 15162 | var queue = hook.queue = { |
| 15163 | pending: null, |
| 15164 | dispatch: null, |
| 15165 | lastRenderedReducer: reducer, |
| 15166 | lastRenderedState: initialState |
| 15167 | }; |
| 15168 | var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue); |
| 15169 | return [hook.memoizedState, dispatch]; |
| 15170 | } |
| 15171 | |
| 15172 | function updateReducer(reducer, initialArg, init) { |
| 15173 | var hook = updateWorkInProgressHook(); |
no test coverage detected