/** * Sample to illustrate the disposal (destruction) of an InfiniteEngineInterface. */ import { InfiniteEngineInterface, InfiniteEvent, InfiniteObjectDispatcherInterfaceSignal } from'generated_files/documentation/appinfiniteapi';
// created previously letlInfiniteEngine : InfiniteEngineInterface;
// what to do when this object is disposed ? constobjectIsDisposed = (_pEvent : InfiniteEvent) : void=> { // perhaps some cleanup code and some gui code ? // detachNode, change dom visibility, etc ... // there is no need to detach event listeners, event listeners have already been detached (and the current // event listener will be unbound just after). console.log('The InfiniteEngineInterface has been cleaned'); };
// bind the event lInfiniteEngine.addEventListener(InfiniteObjectDispatcherInterfaceSignal.ObjectDisposed, objectIsDisposed); // and later
lInfiniteEngine.dispose(); // #/: The InfiniteEngineInterface has been cleaned
The InfiniteObjectDispatcherInterfaceSignal lists all the signals that may be sent by any InfiniteObjectDispatcherInterface.
These signals are emitted by any derived interface of InfiniteObjectDispatcherInterface when the following occurs :
Please refer to InfiniteObjectDispatcherInterface for more information.
See
InfiniteObjectDispatcherInterface