LSEG Data Library for TypeScript

onUpdate

Attaches an event handler function to the stream, which will be called when the stream update is received.

Syntax

stream.onUpdate(callback: OMMStreamUpdateCb)

Parameters

Value Description Data type Optional Default value
callback OMMStreamUpdateCb 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 is updated:

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

await stream
    .onUpdate((data, stream) => console.log(data, stream))
    .open();
54 words (0:17 mins)