Skip to content

Commit 8c9dfdc

Browse files
committed
fix: merge default options too
1 parent 99c694a commit 8c9dfdc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib/swr.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ export function newSWR<T>() {
117117
});
118118

119119
function update(params: SWRParams<T>) {
120-
params = { ...defaultSWRParams, ...params };
120+
params = {
121+
...defaultSWRParams,
122+
...params,
123+
options: {
124+
...defaultSWRParams.options,
125+
...params.options,
126+
},
127+
};
121128
fsm.send("revalidate", params);
122129
}
123130

0 commit comments

Comments
 (0)