Skip to content

Instantly share code, notes, and snippets.

@adamyanalunas
Created November 9, 2012 20:43
Show Gist options
  • Save adamyanalunas/4048124 to your computer and use it in GitHub Desktop.
Save adamyanalunas/4048124 to your computer and use it in GitHub Desktop.
Abstracting event names from broker calls
app.events = {
data: {
},
ui: {
main: {
channel: 'ui.main',
topics: {
layoutLoaded: 'layout.loaded'
}
}
}
};
app.broker.channel(
app.events.ui.main.channel,
app.events.ui.main.topics.layoutLoaded
).publish('');
@adamyanalunas
Copy link
Author

Would be cooler if this was generated (and re-generated) and channel topics were automatically scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment