Skip to content

Commit 0bea4d3

Browse files
committed
extend type of set to accept functional form, see #52
1 parent 1192816 commit 0bea4d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import {
2+
Dispatch,
3+
SetStateAction,
24
useCallback,
35
useEffect,
46
useLayoutEffect,
@@ -132,7 +134,7 @@ const normalizeOptions = <R>(
132134

133135
type UseAsyncStateResult<R> = {
134136
value: AsyncState<R>;
135-
set: (value: AsyncState<R>) => void;
137+
set: Dispatch<SetStateAction<AsyncState<R>>>;
136138
merge: (value: Partial<AsyncState<R>>) => void;
137139
reset: () => void;
138140
setLoading: () => void;

0 commit comments

Comments
 (0)