Skip to content

Instantly share code, notes, and snippets.

@ed-lea
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save ed-lea/06c63ce718991ada63cf to your computer and use it in GitHub Desktop.

Select an option

Save ed-lea/06c63ce718991ada63cf to your computer and use it in GitHub Desktop.
Define a new variable in FramerJS Layer class
class Main extends Layer
constructor: (options={}) ->
# override Layer default
options.width ?= 200
# introduce a new property
options.newProperty ?= 123
super options
@define "newProperty",
get: -> @_newProperty
set: (value) ->
@_newProperty = value
m = new Main
width: 500
newProperty: "ABC"
# Prints ABC
print m.newProperty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment