Skip to main content

FDC3 channel system listener

This is a utility element that listens to the FDC3 system channel (also known as a user or color channel) for the specified context.

Use cases:

  • Listen to and handle events for a specified context system on an FDC3 system channel.

Examples

This will listen to the system channel for changes in the specified context.

Declaration

<fdc3-system-channel-listener></fdc3-system-channel-listener>

Usage

@customElement({
name: 'my-element',
template: html`
<div>Instrument message:<i>${x => x.instrumentMessage}</i></div>
<div>Contact message:<i>${x => x.contactMessage}</i></div>
<fdc3-system-channel-listener
:config="${(x) => [
{
channelType: 'fdc3.instrument',
callback: (message) => x.handleInstrumentMessage(message),
},
{
channelType: 'fdc3.contact',
callback: (message) => x.handleContactMessage(message),
},
]}"
>
</fdc3-system-channel-listener>
`,
})
export class MyElement extends GenesisElement {

@observable contactMessage: any = {};

@observable instrumentMessage: any = {};

handleContactMessage(message) {
this.contactMessage = JSON.stringify(message);
}

handleInstrumentMessage(message) {
this.instrumentMessage = JSON.stringify(message)
}
}

DOM API

Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.

Attributes

This component has no attributes

Properties

PropertyTypeUseExample
configSystemChannelListenerConfigAn array of objects which configure which context type and a handler for channel event payloads
<fdc3-system-channel-listener :config=${() =>
[{ channelType: 'fdc.instrument', callback: (msg) => console.log(JSON.stringify(msg)}]
}>

Slots

This component has no slots.

Parts

This component has no parts.

Fired events

This component doesn't fire any events.

Listened events

This component doesn't listen to any events.