Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StatusTrackingService

Used to manage operations which description must be displayed on UI.

It can be used to implement application-defined UI component to display visual mask that hides part of UI controls until some operations aren't completed.

The typical usage scenario is:

Hierarchy

  • StatusTrackingService

Index

Properties

operationsList

operationsList: Operation[] = new Array<Operation>()

Collection of operations which currently tracked by service and must be displayed on UI.

This collection is managed by trackStatus and changeStatus methods.

status

status: OperationStatus = OperationStatus.Done

Current status of the service.

It is equal to OperationStatus.Progress if operationsList contains any operation. This means that mask can be displayed on UI for example.

When operationsList becomes empty this property becomes equal to OperationStatus.Done.

Static elementVisibilityInterval

elementVisibilityInterval: number = StatusTrackingService.elementVisibilityInterval

Specifies how much time must elapse from moment when operation becomes OperationStatus.Done to it's disappearing from UI.

In fact this is minimal time of operation visibility. If operation was completed right after progressDelayInterval it will be displayed at least specified in this property amount of milliseconds.

Static progressDelayInterval

progressDelayInterval: number = StatusTrackingService.progressDelayInterval

Specifies how much time must elapse from start of operation to it's appearance on UI.

This means that if operation was performed faster than that interval it wouldn't be displayed on UI at all.

This approach helps to avoid situations when mask is hided right after it was rendered since it can be pretty irritating.

Accessors

isActive

  • get isActive(): boolean

Methods

changeStatus

trackStatus

  • trackStatus(title: string): number
  • Registers operation for tracking.

    Parameters

    • title: string

      operation description that must be displayed on UI.

    Returns number

    identifier of setTimeout on elapsing of which operation will be added to operationsList

Object literals

Static settings

settings: object

Global timing settings.

These settings are static and their values are copied to the properties of the same name for each instance of StatusTrackingService type.

So, changing of this settings will affect all instances of StatusTrackingService type that will be created after such changes. If you want to change settings of concrete object you can use it the same name properties.

elementVisibilityInterval

elementVisibilityInterval: number = 500

progressDelayInterval

progressDelayInterval: number = 500

Generated using TypeDoc