Created
February 11, 2019 09:39
-
-
Save yinonov/dc8393ce9059df188dfe45b136e172d2 to your computer and use it in GitHub Desktop.
code example for preserving cart state article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
userChange$ = this.auth.user$.pipe( | |
skip(1), // skip the initial emit to let the onLoad$ do its verification first | |
); | |
cartReset$ = this.userChange$.pipe( | |
filter((user: User) => !user), | |
tap(() => this.setCartValue({ cartItems: [] })), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment