Skip to content

Instantly share code, notes, and snippets.

@marsch
Created December 7, 2012 10:10
Show Gist options
  • Save marsch/4232288 to your computer and use it in GitHub Desktop.
Save marsch/4232288 to your computer and use it in GitHub Desktop.
options.check method
options.check = (composition) ->
if composition.type is type
if _(composition.params).isEqual options.params
return true
else if composition.params?.forceInit
# so the view will be re-initialized everytime
return false
else
# trigger an event in the view that params have changed
# so views can handle the change on there own
composition.view.trigger('change:params', options.params)
return true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment