We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a02e129 commit 013153dCopy full SHA for 013153d
src/utils/produceState.ts
@@ -4,10 +4,7 @@ import produce, { Draft } from 'immer';
4
type RecipeReturnType<S> = S | void | undefined;
5
export type StateProducerRecipe<S> = <D extends Draft<S>>(draft: D) => RecipeReturnType<D>;
6
7
-const produceState = <S>(
8
- setState: Dispatch<SetStateAction<S>>,
9
- recipe: StateProducerRecipe<S>
10
-): void | Promise<void> => {
+const produceState = <S>(setState: Dispatch<SetStateAction<S>>, recipe: StateProducerRecipe<S>): void => {
11
setState((state) => {
12
return produce(state, recipe);
13
});
0 commit comments