addEventListener

Method is used to add a callback method to be triggered on a specified event.

Example

const fn = (data) => {
    console.log(`Connected Account: ${data.address}`);
}
neoline.addEventListener(neoline.EVENT.ACCOUNT_CHANGED, fn);
/* Another */
const fn = (data) => {
    console.log(`Connected Account: ${data.detail.address}`);
}
window.addEventListener('NEOLine.NEO.EVENT.ACCOUNT_CHANGED', fn) ;

最后更新于