What Events are Available in the Famo.us Engine

偶尔善良 提交于 2019-12-02 08:42:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/25449918/what-events-are-available-in-the-famo-us-engine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!