LSEG Data Library for TypeScript

onUpdate

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

Syntax

stream.onUpdate(callback: RDPStreamUpdateCb)

Parameters

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

Returned value

The current RDPStream object.

Usage

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

const stream = Delivery.RDPStream.Definition({
    universe: 'R.BP.L',
    parameters: { universeType: 'Symbol' },
}).getStream();

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