Created
January 29, 2017 20:51
-
-
Save oskarhane/30cbd5d75c26eee24c9bd123acc5e7b1 to your computer and use it in GitHub Desktop.
Basic suber usage
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
import { getBus } from 'suber' | |
const bus = getBus() | |
// Listen on channel / topic / action type | |
// and toggle the sidebar when something arrives | |
bus.take('TOGGLE_SIDEBAR', () => sidebar.toggle()) | |
// In another part of the app | |
// send something on the 'TOGGLE_SIDEBAR' channel | |
bus.send('TOGGLE_SIDEBAR', null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment