Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Emit initState event #316

Merged
merged 1 commit into from
Sep 12, 2020
Merged

Emit initState event #316

merged 1 commit into from
Sep 12, 2020

Conversation

Halynsky
Copy link
Contributor

It's not intuitive and makes some restrictions when you do not emit this event.

1 - Subscribe on this subject never fires. And you need to use a finalize pipe and leave an empty subscribe to get the state of observable. It's a little bit redundant code.

this.socialAuthService.initState
  .pipe(finalize(() => this.socialAuthServiceInitialized = true))
  .subscribe();

2 - You can't use it in angular async pipe. For example:

<button type="button" [disabled]="disabled || !(socialAuthService.initState | async)">Continue with Facebook</button>

Copy link
Contributor

@jaibatrik jaibatrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Contributor

@jaibatrik jaibatrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jaibatrik jaibatrik merged commit 0b0c56a into abacritt:master Sep 12, 2020
@jaibatrik
Copy link
Contributor

Merged and pushed to npm.

@Halynsky
Copy link
Contributor Author

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants