Skip to content

Instantly share code, notes, and snippets.

@bradfordlemley
Created May 30, 2019 14:30
Show Gist options
  • Save bradfordlemley/0ca365dfae1377d505e533372276a03a to your computer and use it in GitHub Desktop.
Save bradfordlemley/0ca365dfae1377d505e533372276a03a to your computer and use it in GitHub Desktop.
Library-to-Library Interactions
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