Refinitiv Data Platform Library for TypeScript

onAdd

Attaches an Add event handler function to the stream chain.

Syntax

streamingChain.onAdd(callback: Pricing.Chain.OnAddCallback)

Parameters

Value Description Data type Optional Default value
callback Pricing.Chain.OnAddCallback function (see Pricing.Chain.Event) function No -

Returned value

Pricing.Chain.Stream object

Usage

The following example demonstrates how to display the messages received when a new constituent is added to the stream.


const streamingChain = await Pricing.Chain.Definition('.AV.HSI').getStream(session);

await streamingChain
    .onAdd((constituent, index) => console.log(`${index}:${constituent}`))
    .open();

None.