Skip to main content

bn.on

on(eventName, handler): void

description Listen on custom event.

example

const supportEvent = await bn.canIUseCustom({
event: 'private-BIDS-example-event-progress' // native version >= 2.49
})
if(supportEvent){
// 1. on-demand subscription, native start to send to events to js
bn.on('private-BIDS-example-event-progress', () => {})
}

Parameters

NameType
eventNamestring
handlerCustomEventHandler

Returns

void


CustomEventHandler

Ƭ CustomEventHandler: (payload: Data) => void

Type declaration

▸ (payload): void

Parameters

NameType
payloadData

Returns

void

Data

Ƭ Data: Object