File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,10 @@ const defaultSWRStore = {
38
38
} ;
39
39
40
40
const defaultSWRParams = {
41
- options : {
42
- enabled : true ,
43
- initialData : undefined ,
44
- // revalidateOnFocus: true,
45
- // revalidateOnReconnect: true,
46
- } ,
41
+ enabled : true ,
42
+ initialData : undefined ,
43
+ // revalidateOnFocus: true,
44
+ // revalidateOnReconnect: true,
47
45
} ;
48
46
49
47
export function useSWR < T > ( ) : SWRStore < T > {
@@ -64,14 +62,8 @@ export function useSWR<T>(): SWRStore<T> {
64
62
} ) ;
65
63
66
64
function update ( params : SWRParams < T > ) {
67
- params = {
68
- ...defaultSWRParams ,
69
- ...params ,
70
- options : {
71
- ...defaultSWRParams . options ,
72
- ...params . options ,
73
- } ,
74
- } ;
65
+ params . options = { ...defaultSWRParams , ...params . options } ;
66
+
75
67
fsm . send ( "revalidate" , params ) ;
76
68
}
77
69
You can’t perform that action at this time.
0 commit comments