question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing subscriptions

See original GitHub issue

I noticed in both grapher-react and the grapher guide, that you create new subscriptions without unsubscribing to the old ones. Even though the subscription handle on the query is overwritten, the old subscription remains active! This is what I do in my Vue helper:

let oldSub = _.clone(query.subscriptionHandle)
query.subscribe()
oldSub && oldSub.stop()

(If you unsubscribe before you subscribe, you lose any data that the old and new subscriptions may have shared, causing flickering).

Maybe query.subscribe() should automatically do this if a subscription already exists?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
theodorDiaconucommented, Jun 23, 2017

@Herteby if you use grapher-react, it uses createContainer(), and inside it it subscribes, createContainer auto unsubscribes anything inside it when it’s unmounted.

1reaction
theodorDiaconucommented, Jun 26, 2017

This process is handled by createContainer, they automatically destroy subscriptions when component is unmounted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to switch to a different subscription plan
Open the Settings app. Tap your name, then tap Subscriptions. Tap the name of the subscription that you want to change. Tap See...
Read more >
Change subscriptions
Learn how to change existing subscriptions. ... Stripe supports changing existing subscriptions without having to cancel and recreate them.
Read more >
Cancel, pause, or change a subscription on Google Play
Open the Google Play app Google Play . · At the top right, tap the profile icon. · Tap Payments & subscriptions and...
Read more >
Change your Microsoft subscription payment method and ...
Subscriptions with recurring billing. If you have a Microsoft subscription with recurring billing, you can change how you pay at any time.
Read more >
Change Your Subscription - Help - The New York Times
Learn how to add another subscription or change your digital subscription. If you have a digital subscriber, you may have the option to......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found