Skip to content

Instantly share code, notes, and snippets.

@jareiko
Created March 9, 2013 00:23
Show Gist options
  • Save jareiko/5121666 to your computer and use it in GitHub Desktop.
Save jareiko/5121666 to your computer and use it in GitHub Desktop.
class Model extends Backbone.Model
initialize: ->
super
monitor = createAttributeMonitor()
# Bind to initial attributes.
monitor @, name for name of @attributes
# Watch for changes to attributes and rebind as necessary.
@on 'change', =>
monitor @, name for name of @changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment