Skip to content

Instantly share code, notes, and snippets.

@mrrocks
Created February 14, 2016 20:34
Show Gist options
  • Save mrrocks/fdfb4b5047ed1f646f77 to your computer and use it in GitHub Desktop.
Save mrrocks/fdfb4b5047ed1f646f77 to your computer and use it in GitHub Desktop.
Layer class custom properties
class Class extends Layer
@define "newProperty",
get: ->
@property
set: (value) ->
@property = value
@emit "change:newProperty"
object = new Class
object.on "change:newProperty", ->
print this.newProperty
object.newProperty = 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment