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
Name | Type |
---|---|
eventName | string |
handler | CustomEventHandler |
Returns
void
CustomEventHandler
Ƭ CustomEventHandler: (payload
: Data
) => void
Type declaration
▸ (payload
): void
Parameters
Name | Type |
---|---|
payload | Data |
Returns
void
Data
Ƭ Data: Object