What Events are Available in the Famo.us Engine

2020-04-21 07:31发布

I am wanting to know what events are available to subscribe to, for the Famo.us Engine object. From the Famo.us university:

the Engine also emits certain events such as 'prerender' and 'postrender.' However, due to the frequency of these events, they should be used only when absolutely necessary.

There are other Engine events that are handy though, namely 'resize.'

So, what are all of these 'certain events' the engine emits? Also, what 'other Engine events that are handy' are avaible to subscribe to? I can't find a list anywhere of what events are available. If someone know the answer to this, can you also tell me how you found this answer? Is my only option to dig through the source code for any events?

标签: famo.us
1条回答
孤傲高冷的网名
2楼-- · 2020-04-21 08:04

I don't know as of this writing if there is documentation yet for the Engine events. But by doing a search on Github, you can see the custom events emitted to the event handler (.emit('<event name>',.... This search will also show you the custom events emitted by other objects in Famo.us

Custom Events by Engine:

  • prerender
  • postrender

Github Search of Famo.us Code

All of the events emmited other than prerender and postrender for Engine.on('<event name>', function()... are the DOM events from the root of the Famo.us render tree. This is true for all the renderables of a Famo.us application.

Here is an example

You can reference these events here among other places.

查看更多
登录 后发表回答