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 9a7187c commit 5133e15Copy full SHA for 5133e15
src/lib/swr.ts
@@ -33,16 +33,22 @@ const defaultSWRStore = {
33
34
const defaultSWRParams = {
35
options: {
36
+ enabled: true,
37
initialData: undefined,
38
// revalidateOnFocus: true,
39
// revalidateOnReconnect: true,
40
},
41
};
42
43
+const isEnabled = (_, event) => event.data.options.enabled;
44
+
45
const swrMachine: FSMMachineConfig = {
46
initial: "init",
47
on: {
- revalidate: "revalidating",
48
+ revalidate: {
49
+ target: "revalidating",
50
+ cond: isEnabled,
51
+ },
52
53
states: {
54
init: {},
0 commit comments