Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Conversation

eliykat
Copy link
Member

@eliykat eliykat commented Oct 11, 2021

Objective

As discussed in bitwarden/jslib#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.

This does not strictly depend on bitwarden/jslib#516, but we should include the jslib update in this PR so that it's all together.

@addisonbeck
Copy link
Contributor

Merge conflicts RIP 😔

@eliykat eliykat merged commit 98bd41d into master Oct 14, 2021
@eliykat eliykat deleted the refactor/query-params-unsubscribe branch October 14, 2021 22:59
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