Last active
May 11, 2018 22:08
-
-
Save steveruizok/ed82fb14de349a47ea40f614b7d1e661 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass extends Layer | |
constructor: (options = {}) -> | |
super options | |
@_isRightEnough = @x > 200 | |
@onIsRightEnough = -> null | |
@on "change:x", -> | |
isRightEnough = @x > 200 | |
return if isRightEnough is @_isRightEnough | |
@_isRightEnough = isRightEnough | |
@emit "change:isRightEnough", @_isRightEnough, @ | |
@onIsRightEnough(@_isRightEnough) | |
myInstance = new MyClass | |
myInstance.onIsRightEnough = (bool) -> print bool | |
myInstance.draggable.enabled = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment