Execute twice when use useObserveableState & useSubscription together
See original GitHub issueSteps to reproduce
- useObservable
const value$ = useObservable(input$ => input$ |> switchMap([v] => ajax(...)), [props.value])
- useObservableState
const value = useObservableState(value$)
- useSubscription
useSubscription(value$, v => props.onChange(v))
What is expected?
just request once
what is actually happening?
request twice
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Subscriptions - Apollo GraphQL Docs
Executing a subscription. You use Apollo Client's useSubscription Hook to execute a subscription from React. Like useQuery , useSubscription returns an object ...
Read more >Subscriptions - Client (React) - Apollo GraphQL Docs
Executing a subscription. You use Apollo Client's useSubscription Hook to execute a subscription from React. Like useQuery , useSubscription returns an object ...
Read more >FetchMore : Request executed twice every time - Stack Overflow
My problem is the request is executed twice every time. I have no idea why. The first time, it is executed with a...
Read more >useSubscription | Relay
API reference for useSubscription, a React hook used to subscribe and unsubscribe ... for use as a unique id for a given instance...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a amazing project! Thanks again!
You should not do that in
useObservable
.