Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

[Refactor] Use rxjs first instead of unsubscribe from queryParams #516

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

eliykat
Copy link
Member

@eliykat eliykat commented Oct 11, 2021

Objective

As discussed in #470, we currently call unsubscribe() on the queryParams object from within its callback. This is a bit of an anti-pattern and can throw an error about the subscription variable being undefined.

Code changes

Use the rxjs first operator instead. This will automatically unsubscribe from the observable after the first value is emitted. We should use this pattern from now on.

@eliykat eliykat merged commit a20e935 into master Oct 14, 2021
@eliykat eliykat deleted the refactor/query-params-unsubscribe branch October 14, 2021 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants