问题
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