Function
reducer
(state: Record<string, unknown> = initialState, action: { type: string; newValue: any })
Source from the content-addressed store, hash-verified
| 431 | |
| 432 | const ACTION_TYPE = 'UPDATE_VALUE'; |
| 433 | const reducer = (state: Record<string, unknown> = initialState, action: { type: string; newValue: any }) => { |
| 434 | if (action.type === ACTION_TYPE) { |
| 435 | return { |
| 436 | ...state, |
| 437 | value: action.newValue, |
| 438 | }; |
| 439 | } |
| 440 | return state; |
| 441 | }; |
| 442 | |
| 443 | const store = Redux.createStore(reducer, enhancer); |
| 444 | |
Tested by
no test coverage detected