Creates a new instance of an event emitter.
Event emitter.
import { createEmitter } from '@pacote/emitter'const emitter = createEmitter()emitter.on('greet', () => console.log('Hello, world!'))emitter.emit('greet') // => 'Hello, world!' Copy
import { createEmitter } from '@pacote/emitter'const emitter = createEmitter()emitter.on('greet', () => console.log('Hello, world!'))emitter.emit('greet') // => 'Hello, world!'
Creates a new instance of an event emitter.