@jtorm/event-model
v1.0.0
Published
jTorm Event Model
Downloads
145
Readme
jTorm Event Model
Manage events.
Install
npm install @jtorm/event-model
How To
By default, there are three main events where you can add plugins to before and after execution. With a weight you can set the order in which the plugins are processed. The main events are iteration (handler-wrapper), method (handler) and view (can be added around execution).
Example
In your plugin class, register it by setting the desired location with a weight like this:
event: {
after: {
view: {
weight: 0
}
}
},
And by naming the handler function accordingly, in this case afterView
:
handlerName: {
before: {
iteration: 'beforeIteration',
method: 'beforeMethod',
view: 'beforeView'
},
after: {
iteration: 'afterIteration',
method: 'afterMethod',
view: 'afterView'
}
},
You can view the @jtorm/ui-cache-plugin
as an example.