Created
September 20, 2022 07:26
-
-
Save Debdut/4e3b97073cf4f2425d9e87e81a20bb48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Reducer = ( | |
{ search, autocomplete }: InitialStateType, | |
action: SearchAction | AutoCompleteAction | |
) => ({ | |
search: SearchReducer(search, action as SearchAction), | |
autocomplete: AutoCompleteReducer(autocomplete, action as AutoCompleteAction) | |
}); | |
const [state, dispatch] = useReducer(Reducer, InitialState); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment