Skip to content

Instantly share code, notes, and snippets.

@frostney
Created February 24, 2014 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frostney/9197604 to your computer and use it in GitHub Desktop.
Save frostney/9197604 to your computer and use it in GitHub Desktop.
Observable class draft, not complete what I want yet, just a little experiment
class Observable
constructor: (data) ->
@changes = []
Object.defineProperty @, 'data',
get: -> data
set: (value) ->
data = value
i() for i in @changes
value
change: (callback) -> @changes.push callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment