Skip to content

Instantly share code, notes, and snippets.

@kkoskelin
Created April 17, 2014 16:08
Show Gist options
  • Save kkoskelin/10994775 to your computer and use it in GitHub Desktop.
Save kkoskelin/10994775 to your computer and use it in GitHub Desktop.
Mediator 'pull'
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
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