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

What is Framer? Join the Community
Return to index
Jordi Martinez Ortega
Posted May 13 - Read on Facebook

is there anyway I can create a class that extends from EventEmitter?

13 Comments

Seoh Char

like this?

Jordi Martinez Ortega

wow. yes! I had no idea I could access Framer classes using Framer prefix. Thanks a lot!

Chris Camargo

JS/CS n00b here. What's the practical application for this? What does it allow you to do?

Jordan Robert Dobson

He's hooking into when events get fired. And doing custom stuff.

Isa Bison

Chris Camargo

Dude, Isa! Thank you! Over a year later and swoops in for the kill.

Jordan Robert Dobson

Dude we already did this! 😁😂

Chris Camargo

I know we worked on options, but this is clean AF. Maybe it's been a while since I looked at those solutions, but this is making all kinds of sense right now.

Chris Camargo

By the way, what's :: doing there? I've never used that before. I'm actually unclear on the whole line.

Isa Bison

Urf. These CS shortcuts. This is preferable:

Chris Camargo

Ah! You're passing it up the chain to EventEmitter!

Jordan Robert Dobson

Yep. You don't really even need to extend. But you can. Awesome this making sense. :)

Isa Bison

:: is CoffeeScript shortcut for JS prototype. Which, to be very brief, is an idea/structure that JS uses in place of actual inheritance.

Read the entire post on Facebook