Suggestion: overload `useSubscription` to add support for observer objects
See original GitHub issueThe subscribe
function of an Observable
can receive an observer object:
const observer = { next: myNext, error: myError, complete: myComplete }
ob$.subscribe(observer)
It would be great if useSubscription
allowed the same, so we can do this:
useSubscription(ob$, observer)
… instead of this:
useSubscription(ob$, observer.next, observer.error, observer.complete)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Suggestion: overload `useSubscription` to add support for observer ...
5 Answer: Hi, we purposely did not support the observer object for performance reason. It would create less garbage and easier to handle...
Read more >Subscriptions - Apollo GraphQL Docs
Like useQuery , useSubscription returns an object from Apollo Client that contains loading , error , and data properties you can use to...
Read more >Observables compared to other techniques - Angular
Observable subscriptions are cancellable. Unsubscribing removes the listener from receiving further values, and notifies the subscriber function to cancel work.
Read more >HANFORD JOINT UNION HIGH SCHOOL DISTRICT BOARD OF ...
Kings County Office of Education- Universal Design for Learning Support for ... Our schools include many areas for student daily activities including ...
Read more >GraphQL subscriptions - Relay
Note that subscriptions can also reference GraphQL variables in the same way queries or fragments do. Using useSubscription to create a subscription. In...
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 Free
Top 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
I’ll raise a PR.
Thanks for the fantastic lib btw. Migrating the Unsplash app over from rxjs-hooks, this is much more flexible.
Hey I haven’t had the chance sorry, I still really want it though!