Skip to content

Commit

Permalink
fix(react): set fetching to the lack or presence of source (#2667)
Browse files Browse the repository at this point in the history
* set `fetching` to the lack or presence of `source`

* Create tame-crews-grab.md
  • Loading branch information
JoviDeCroock authored Sep 4, 2022
1 parent 50c39fc commit 1b15c5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tame-crews-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"urql": patch
---

Fix `fetching` going to `false` after changing variables in a subscription
2 changes: 1 addition & 1 deletion packages/react-urql/src/hooks/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function useSubscription<
return pipe(
state[0],
onEnd(() => {
updateResult({ fetching: false });
updateResult({ fetching: !!source });
}),
subscribe(updateResult)
).unsubscribe;
Expand Down

0 comments on commit 1b15c5f

Please sign in to comment.