Skip to content

Instantly share code, notes, and snippets.

@Enome
Created October 14, 2011 15:55
Show Gist options
  • Save Enome/1287484 to your computer and use it in GitHub Desktop.
Save Enome/1287484 to your computer and use it in GitHub Desktop.
Viewmodel with observer
class Project
constructor : ->
@data =
id : ko.observable()
name : ko.observable()
client : ko.observable()
observer = new Observer @data, @update, ['id']
observer.start() #start looking for changes
#observer.stop() #stop looking for changes
update : ->
#do database stuff here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment