File

src/session/loading/global_loading_activity.ts

Description

This service can be used for receiving notifications regarding loading activity across all Blueriq sessions. For loading activity of only a single session, first use forSession to obtain a LoadingActivity service that targets only a single Blueriq session.

To show session-local loading activity based on the session's own loading service, use the loading event of the BqProjectComponent or BqSessionComponent. If you need to show loading activity based on all sessions, inject GlobalLoadingActivity from an Angular module instead.

Extends

LoadingActivity

Index

Methods

Constructor

constructor()

Methods

forSession
forSession(sessionName: string)
Parameters :
Name Type Optional
sessionName string No
Returns : LoadingActivity
ngOnDestroy
ngOnDestroy()
Returns : void
destroy
destroy()
Returns : void
isActive
isActive(activity: ActivityType)

Creates a stream of activity events for the given type. When the given loading activity starts, the value true will be emitted, followed by false once the loading activity completes. The observable is guaranteed to emit the current activity immediately (i.e. synchronously) on subscription.

If you need activity events but want to account for a small delay before actually showing a spinner for example, consider using isActiveWithDelay instead.

Parameters :
Name Type Optional Description
activity ActivityType No

The type of activity you want to receive events for.

Returns : Observable<boolean>
isActiveWithDelay
isActiveWithDelay(activity: ActivityType, delayInMilliseconds: number)

Creates a stream of activity events for the given type, while allowing for the announcement of starting the activity being delayed a certain number of milliseconds. If within this delay the loading activity has already completed, you will not receive a notification at all.

Immediately when subscribed, you will synchronously receive false to indicate that no activity is currently taking place. It will always take the given delay in milliseconds to potentially receive a signal of true. This behavior is chosen as it guarantees a synchronous emission on subscription, which is preferable in the typical situation where multiple types of activity are combined together using combineLatest.

Parameters :
Name Type Optional Description
activity ActivityType No

The type of activity you want to receive events for.

delayInMilliseconds number No

Delay in milliseconds to wait for when announcing the start of the activity.

Returns : Observable<boolean>
start
start(activity: ActivityType)

Starts a given activity.

Parameters :
Name Type Optional
activity ActivityType No
Returns : void
stop
stop(activity: ActivityType)

Stops a given activity. This must be kept in sync with start to avoid invalid state.

Parameters :
Name Type Optional
activity ActivityType No
Returns : void

result-matching ""

    No results matching ""