Service for creating background tasks

Hierarchy

Methods

  • Create a new background task

    Returns

    a promise that resolves to the id of the task if it was created successfully

    Parameters

    • url: string

      url to the resource that will create the task

    • data: any

      task specific data

    • Optional cancelAction: boolean

      true to allow task creation to be cancelled

    • Optional message: string

      notification message to display before the task is created instead of the default one

    Returns Promise<string | void>

  • Get status about specific tasks

    Returns

    a promise that resolves to the status about the tasks

    Parameters

    • ids: string[]

      the ids of the tasks to check

    Returns Promise<TaskStatus[]>

  • Subscribe to state changes

    Returns

    unsubscribe callback

    Parameters

    • callback: ((...args: unknown[]) => void)

      function to call when subscription updates

        • (...args: unknown[]): void
        • Parameters

          • Rest ...args: unknown[]

          Returns void

    • Optional options: StateOptions

      options for the state selector

    Returns (() => void)

      • (): void
      • Subscribe to state changes

        Returns

        unsubscribe callback

        Returns void