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

What is Framer? Join the Community
Return to index
German Bauer
Posted Aug 16 - 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 ?


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