Created
September 28, 2013 14:34
-
-
Save alexspeller/6742679 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| App.PushClient = Em.Object.extend | |
| init: -> | |
| @connection = connectToSocketIOSomehow() | |
| subscribe: (channel, callback) -> | |
| @connection.subscribe channel, callback | |
| App.register 'pushClient:main', App.PushClient | |
| App.inject 'router', 'pushClient', 'pushClient:main' # inject pushClient into router | |
| # optional | |
| App.inject 'pushClient', 'store', 'store:main' #inject store into pushClient | |
| App.inject 'pushClient', 'router', 'router:main' #incject router into pushClient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment