Skip to content

Commit b2389e6

Browse files
committed
Make sure that the error/value fields are cleared when necessary
1 parent f2ebfc3 commit b2389e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

util/useLoadingValue.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ const reducer = <E>() => (
3737
...state,
3838
error: action.error,
3939
loading: false,
40+
value: undefined,
4041
};
4142
case 'reset':
4243
return defaultState(action.defaultValue);
4344
case 'value':
4445
return {
4546
...state,
47+
error: undefined,
4648
loading: false,
4749
value: action.value,
4850
};

0 commit comments

Comments
 (0)