Tutorial: fdc3.broadcast

fdc3.broadcast

Broadcasts a context for the channel of the current entity. The entity must be part of a channel in order to set a context.

This is a wrapper for interop.setContext.

Example

setInstrumentContext = async (ticker) => {
    fdc3.broadcast({type: 'fdc3.instrument', id: {ticker}})
}

// The user clicks an instrument of interest. We want to set that Instrument context so that the rest of our workflow updates with information for that instrument
instrumentElement.on('click', (evt) => {
    setInstrumentContext(evt.ticker)
})