This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Managed by Frits | |
const init = () => { | |
let _handler = () => {}; // just an empty function in case no listener is registered. | |
setTimeout(() => { | |
_handler({ myEventData: 'something' }); | |
}, 1000); | |
return { | |
onEvent: (handler) => { _handler = handler } |