Created
May 30, 2019 14:30
-
-
Save bradfordlemley/0ca365dfae1377d505e533372276a03a to your computer and use it in GitHub Desktop.
Library-to-Library Interactions
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
const todoLib = createTodoLib(); | |
const authLib = createAuthLib(); | |
authLib.state$.subscribe(state => { | |
todoLib.setUser(state.user); | |
}); | |
todoLib.state$.subscribe(state => { | |
if (state.authFailed) { | |
authLib.refresh(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment