Skip to content

Instantly share code, notes, and snippets.

@willprice76
Created May 1, 2020 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willprice76/c7794711264283e148621d9e2eabd636 to your computer and use it in GitHub Desktop.
Save willprice76/c7794711264283e148621d9e2eabd636 to your computer and use it in GitHub Desktop.
Updated to use generic reducer
//component state
const [{ data, isBusy, hasError, errorMessage }, dispatch] = useReducer(
createActionReducer<Recipe[]>(),
{ isBusy: true, hasError: false }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment