projects/wms-framework/src/lib/basecomponentmodel/Dispatcher.ts
Dispatcher class
Properties |
|
Methods |
|
Private Static dispatcherInstance |
Default value : new Dispatcher()
|
Public BeginInvoke | |||||||||
BeginInvoke(func: Function, ...args: any[])
|
|||||||||
Invokes a function from the dispatcher
Parameters :
Returns :
void
|
Public CheckAccess |
CheckAccess()
|
Check if the dispatcher has access to invoke a function
Returns :
boolean
|
Static GetDispatcher |
GetDispatcher()
|
Gets the dispatcher
Returns :
Dispatcher
|
export class Dispatcher {
private static dispatcherInstance = new Dispatcher();
/**
* Gets the dispatcher
*
* @static
* @returns {Dispatcher}
* @memberof Dispatcher
* @wIgnore
*/
public static GetDispatcher(): Dispatcher {
return Dispatcher.dispatcherInstance;
}
/**
* Check if the dispatcher has access to invoke a function
*
* @returns {boolean}
* @memberof Dispatcher
*/
public CheckAccess(): boolean {
return true;
}
/**
* Invokes a function from the dispatcher
*
* @param {Function} func
* @param {...any[]} args
* @memberof Dispatcher
*/
public BeginInvoke(func: Function, ...args: any[]) {
setTimeout(() => func.apply(window, args));
}
}