Please create a new event, add an event listener, and clear it.
Memory leak
Arrange and remove event listener
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
}
function handleEvent() {
import EventEmitter from 'events'
emitter.off('myEvent', handleEvent);
emitter.on('myEvent', handleEvent);
console.log('log event');
const emitter = new EventEmitter();
emitter.emit('myEvent');
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.