File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import call from '../utils/call';
5
5
import useAutoRef from './useAutoRef' ;
6
6
7
7
interface NoResult {
8
- _noResult : string ;
8
+ readonly _noResult : string ;
9
9
}
10
10
11
11
const isNoResult = < T > ( value : T | NoResult , noResult : NoResult ) : value is NoResult => {
12
- return isObject ( value ) && '_noResult' in value && value . _noResult === noResult . _noResult ; //TODO just value === noResult ?
12
+ return isObject ( value ) && '_noResult' in value && value === noResult ; //TODO just value === noResult ?
13
13
} ;
14
14
15
15
type MemoFactory < R > = ( noResult : NoResult ) => R | NoResult ;
@@ -22,9 +22,9 @@ const createDebouncedMemoHook =
22
22
23
23
const debounceFunction = useRef (
24
24
call ( ( ) => {
25
- const actualNoResult : NoResult = {
25
+ const actualNoResult : NoResult = Object . freeze ( {
26
26
_noResult : v4 ( )
27
- } ;
27
+ } ) ;
28
28
29
29
return debounceFn ( ( ) => {
30
30
const value = factoryRef . current ( actualNoResult ) ;
You can’t perform that action at this time.
0 commit comments