File

core/realtime/realtime.service.ts

Description

A wrapper class for handling realtime notifications in RxJS fashion.

Index

Methods
Accessors

Constructor

constructor(realtimeSubject: RealtimeSubjectService)
Parameters :
Name Type Optional
realtimeSubject RealtimeSubjectService No

Methods

Protected Abstract channel
channel()
Returns : string
Protected getChannel
getChannel(entityOrId?: string | number | IIdentified)
Parameters :
Name Type Optional
entityOrId string | number | IIdentified Yes
Returns : any
Protected getIdString
getIdString(reference: number | string | IIdentified)
Parameters :
Name Type Optional
reference number | string | IIdentified No
Returns : string
onAll$
onAll$(entityOrId?: string | number | IIdentified)

Get an Observable of all realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

An [[Observable]] of notifications wrapped as [[RealtimeMessage]]

onCreate$
onCreate$(entityOrId?: string | number | IIdentified)

Get an Observable of all CREATE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<T>

An [[Observable]] of newly created entity objects.

onDelete$
onDelete$(entityOrId?: string | number | IIdentified)

Get an Observable of all DELETE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<number>

An [[Observable]] of deleted entity objects.

onUpdate$
onUpdate$(entityOrId?: string | number | IIdentified)

Get an Observable of all UPDATE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<T>

An [[Observable]] of updated entity objects.

start
start()

Subscribes again all realtime channels with active observers.

Returns : void
stop
stop()

Stops realtime notifications and unsubscribes all realtime channels.

Returns : void

Accessors

active
getactive()

A flag displaying if realtime notifications are currently active.

Returns : boolean
reconnect$
getreconnect$()

An observable emitting a value in case the realtime connection has been interrupted. Can be used to reload data of e.g. a datapoint graph that wasn't received while realtime was interrupted.

Returns : Observable<void>
connectionStatus$
getconnectionStatus$()

An observable emitting either connected or disconnected depending on the state of the realtime connection. Can be used to e.g. inform the user about the interrupted realtime connection.

Returns : Observable<"connected" | "disconnected">

results matching ""

    No results matching ""