Component events
Component events
Listen for component lifecycle events emitted while users edit a Fliplet screen — such as adding, added, removed, moved, and render — via Fliplet.Hooks.on('componentEvent').
Usage
Fliplet.Hooks.on('componentEvent', function(event) {
console.log(event.type); // Event type
});
Parameters
Fliplet.Hooks.on('componentEvent', fn);
fn(Function(event)) Required Callback function to process the eventevent(Object)type(String) Type of component eventPossible values
adding- Component is being addedadded- Component is successfully addedaddFailed- Component failed to addremoved- Component removedmoved- Component movedrender- Component rendered
target(ComponentNode) Target node where the component is added to, removed from or moved tosource(ComponentNode) Where the node is moved from, if the event type ismovedadded(ComponentNodeList) A list of component nodes addedremoved(ComponentNodeList) A list of components nodes removed
ComponentNode
A node representing a component or a component view container.
Properties
widgetId(Number) Widget instance IDhelperId(String) Helper instance IDpackage(String) Package name for the widget instancename(String) Registered widget or helper nameview(String) Name of a widget or helper view container
Examples
Fliplet.Hooks.on('componentEvent', function(event) {
});