( state: CurrentCollection | undefined = defaultCurrentCollection, action: CurrentCollectionAction, )
| 75 | | SetIsChangedAction; |
| 76 | |
| 77 | function currentCollectionReducer( |
| 78 | state: CurrentCollection | undefined = defaultCurrentCollection, |
| 79 | action: CurrentCollectionAction, |
| 80 | ): CurrentCollection | undefined { |
| 81 | switch (action.type) { |
| 82 | case CurrentCollectionActionType.SET: |
| 83 | return set(action.collection); |
| 84 | case CurrentCollectionActionType.UNSET: |
| 85 | return unset(); |
| 86 | case CurrentCollectionActionType.PATCH_DATA: |
| 87 | return patchData(state, action.data); |
| 88 | case CurrentCollectionActionType.SET_IS_CHANGED: |
| 89 | return setIsChanged(state, action.isChanged); |
| 90 | default: |
| 91 | console.error('Invalid action type', action); |
| 92 | return state; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | export type { CurrentCollectionAction }; |
| 97 |
nothing calls this directly
no test coverage detected