Type class
Universal Event Dispatcher.
Sources
EventDispatcher can be used (imported) via one of the following packages.
/** * -------------------------------------------------------- * Import from: "core.ts" * Use like: am4core.EventDispatcher * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4/core";
/** * -------------------------------------------------------- * Include via: <script src="core.js"></script> * Access items like: am4.EventDispatcher * -------------------------------------------------------- */
Inheritance
EventDispatcher does not extend any other symbol.
EventDispatcher is extended by TargetedEventDispatcher
.
Properties
EventDispatcher does not have any properties.
Methods
constructor() |
Returns Constructor |
---|---|
copyFrom( source: ) |
Returns Copies all dispatcher parameters, including listeners, from another event dispatcher. |
disable() |
Returns Disable dispatching of events until re-enabled by |
disableType( type: ) |
Returns Disable dispatching of events for a certain event type. Optionally, can set how many dispatches to skip before automatically re-enabling the dispatching. |
dispatch( type: ) |
Returns Shelves the event to be dispatched within next update cycle. @todo automatically add in type and target properties if they are missing |
dispatchImmediately( type: ) |
Returns Dispatches an event immediately without waiting for next cycle. @todo automatically add in type and target properties if they are missing |
dispose() |
Returns Dispose (destroy) this object. |
enable() |
Returns Enable dispatching of events if they were previously disabled by |
enableType( type: ) |
Returns Enable dispatching particular event, if it was disabled before by |
has( type: ) |
Returns Checks if there's already a listener with specific parameters. |
hasListeners() |
Returns Checks if this particular event dispatcher has any listeners set. |
hasListenersByType( type: ) |
Returns Checks if this particular event dispatcher has any particular listeners set. |
isDisposed() |
Returns Returns if this object has been already disposed. |
isEnabled( type: ) |
Returns Checks if dispatching for particular event type is enabled. |
off( type: ) |
Returns Removes the event listener with specific parameters. |
on( type: ) |
Returns Creates an event listener to be invoked on a specific event type. series.events.on("hidden", (ev) => { console.log("Series hidden: " + ev.target.name); }, this); series.events.on("hidden", function(ev) { console.log("Series hidden: " + ev.target.name); }, this); { // ... "series": [{ // ... "events": { "hidden": function(ev) { console.log("Series hidden: " + ev.target.name); } } }] } The above will invoke our custom event handler whenever series we put event on is hidden. @todo what if |
onAll( callback: ( this: ) |
Returns Creates an event listener to be invoked on any event. @todo what if |
once( type: ) |
Returns Creates an event listener to be invoked on a specific event type once. Once the event listener is invoked, it is automatically disposed. series.events.on("hidden", (ev) => { console.log("Series hidden: " + ev.target.name); }, this); series.events.on("hidden", function(ev) { console.log("Series hidden: " + ev.target.name); }, this); { // ... "series": [{ // ... "events": { "hidden": function(ev) { console.log("Series hidden: " + ev.target.name); } } }] } The above will invoke our custom event handler the first time series we put event on is hidden. @todo what if |
Events
EventDispatcher does not have any events.
Adapters
EventDispatcher does not have any adapters.