This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
German Bauer
Posted Nov 15 - Read on Facebook

If I'm building my own components, is there a way that they can emit custom events?
If so does someone have a best practices example for defining and throwing custom events ?


Rohan K

Mike Feldstein is it possible to also pass along some more information along with emit event? I am looking to send event as well as a value

Mike Feldstein

class GermansUnit extends Framer.EventEmitter
constructor: () ->
setInterval @doEmit, 1000
doEmit: () =>
@emit "some-event"

unit = new GermansUnit
unit.on "some-event", ->
print("Hey Hey")

German Bauer

Thanks Mike, much appreciated!

Read the entire post on Facebook