LSEG Data Library for TypeScript

onStatus

Attaches an event handler function to the stream, which will be called when the status of one of the requested instruments changes.

Syntax

stream.onStatus(callback: OMMStreamStatusCb)

Parameters

Value Description Data type Optional Default value
callback OMMStreamStatusCb function (see OMMStream.Event). function No -

Returned value

The current OMMStream object.

Usage

The following example demonstrates how to display messages received when the stream status is successfully received:

const stream = Delivery.OMMStream.Definition({
    name: 'EUR=',
    fields: ['DSPLY_NAME']
}).getStream();

await stream
    .onStatus((data, stream) => console.log(data, stream))
    .open();

OMMStream.Event

59 words (0:19 mins)