LSEG Data Library for TypeScript

onRefresh

Attaches an event handler function to the stream, which will be called when the stream is refreshed by the server.

Syntax

stream.onRefresh(callback: OMMStreamRefreshCb)

Parameters

Value Description Data type Optional Default value
callback OMMStreamRefreshCb 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 refreshed by the platform or it was opened successfully:

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

await stream
    .onRefresh((data, stream) => console.log(data, stream))
    .open();
64 words (0:20 mins)