Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

events$ observable updates before other observables are updated #152

Closed
leonluc-dev opened this issue Sep 15, 2022 · 1 comment
Closed

Comments

@leonluc-dev
Copy link
Contributor

Currently the events$ observable fires before any of the properties in the auth-service are updated.
This causes issues when we want to do authenticated actions from the event handlers.
For example:

authService.events$.subscribe((event) => {
    if(event.action === AuthActions.SignInSuccess) {
        authService.loadUserInfo();
    }
}); 

This will cause the loadUserInfo call to fail since the token isn't set yet.

@leonluc-dev leonluc-dev changed the title events$ observable updates before property observables are updated events$ observable updates before other observables are updated Sep 15, 2022
@leonluc-dev
Copy link
Contributor Author

I've opened a PR #153 that would fix this issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant