Created
April 2, 2021 19:55
-
-
Save hozefam/1e86c54a3e85eb476baca0788a44ad0b to your computer and use it in GitHub Desktop.
fromEvent - RxJS
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
import events from 'events'; | |
const eventEmitter = new events.EventEmitter(); | |
eventEmitter.on('click', () => {}); | |
fromEvent(eventEmitter, 'click').subscribe((x) => log('click event called')); | |
eventEmitter.emit('click'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment