@nospamproxy/core
    Preparing search index...

    A manager for the interaction between async operations and disabled controls.

    The state of controls is defined through two following properties:

    • isBusy - Indicates if an async operation is running.
    • isApplicable - Indicates if the current UI is applicable.
    • isDisabled - Indicates if controls should be disabled. This is a shorthand for isBusy || !isApplicable.

    When a "finish" button in a dialog is clicked and a web request is made to complete an action, the activity manager for that dialog is set busy to disable all controls and to indicate that an async operation is running.

    When a part of the UI is disabled because a checkbox is unchecked, the activity manager for that part of the UI is set unapplicable to render all contained controls disabled.

    (Note that an activity manager is a container wide singleton and multiple activity managers may share the same state)

    Index

    Constructors

    Properties

    Accessors

    • get isApplicable(): boolean

      Check if this manager and all of it's parents is set applicable.

      Returns boolean

    • get isBusy(): boolean

      Check if this manager or any of it's parents is set busy.

      Returns boolean

    • get isDisabled(): boolean

      Shorthand for isBusy || !isApplicable.

      This can be used by controls to control their disabled state.

      Returns boolean

    • get isSelfBusy(): boolean

      Check if this manager is set busy.

      Returns boolean

    • get parent(): ActivityManager | undefined

      The parent activity manager or undefined if this is the root.

      Returns ActivityManager | undefined

    Methods

    • Create a new activity that influences the state of this manager and all child managers.

      Returns Activity

    • Handle an error using this activity manager.

      Error handlers are called in the following order until one succeeds:

      • This activity manager's error handler.
      • Any parent activity manager's error handler.
      • The global error handler.

      If none of the above error handlers succeed, the error is rethrown.

      Parameters

      • error: unknown

      Returns void

    • Set this manager busy until the given async operation completes.

      Parameters

      • asyncOperationOrFn: Promise<unknown> | (() => Promise<unknown>)

        A promise or function that is called immediately.

      Returns void

    • Use the specified error handler if an error occurs in the context of this activity manager.

      Parameters

      Returns void

    • Register the ActivityManager to the root container to ensure that a root activity manager is always available.

      Parameters

      • container: IContainer

      Returns void

      container.register(ActivityManager);
      
    • Register the specified error handler as a global fallback for all activity managers.

      Parameters

      Returns void