LSEG Data Library for TypeScript

onComplete

Attaches an event handler function to the stream, which will be called once all the requested instruments have received either a Refresh or a Status event.

Syntax

stream.onComplete(callBack: OMMStreamCompleteCb)

Parameters

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

Returned value

The current OMMStream object.

Usage

The following example demonstrates how to display the messages received when all the data is successfully retrieved:

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

await stream
    .onComplete((stream) => console.log('Complete', stream))
    .open();
65 words (0:21 mins)