File

projects/wms-framework/src/lib/basecomponentmodel/Dispatcher.ts

Description

Dispatcher class

Index

Properties
Methods

Properties

Private Static dispatcherInstance
Default value : new Dispatcher()

Methods

Public BeginInvoke
BeginInvoke(func: Function, ...args: any[])

Invokes a function from the dispatcher

Parameters :
Name Type Optional
func Function No
args any[] No
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));
  }
}

result-matching ""

    No results matching ""