Created
April 17, 2014 16:08
-
-
Save kkoskelin/10994775 to your computer and use it in GitHub Desktop.
Mediator 'pull'
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
class MyView extends Backbone.View | |
render: -> | |
# ... | |
@myparam = {} | |
@_getInfo() | |
_getInfo: -> | |
Backbone.Mediator.publish 'some:thing', @myparam | |
_.delay _.bind(@_infoGot, this), 0 | |
_infoGot: -> | |
App.log "Hey, now I know all about this: ", @myparam |
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
class AnotherView extends Backbone.View | |
subscriptions: | |
'some:thing': (theirParam) -> | |
theirParam['anotherView'] = "Yep!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment