![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
better-emitter
Advanced tools
A very simple event emitter with a better API than all the others.
It's better because:
on
and once
return an unsubscribe functionthis
, which means you can pass around the on
or emit
functionsAlso, it's pretty simple. Check out the source code.
npm i better-emitter
const createEmitter = require('better-emitter')
const emitter = createEmitter()
const unsubscribe = emitter.on('thing happened', (really, { stopPropagation }) => {
really // => true
typeof stopPropagation // => 'function'
})
emitter.emit('thing happened', true)
unsubscribe()
emitter = createEmitter([obj])
This is the function exported by the module. It creates a new event emitter object. You can also pass in any object you want, and event emitter functions will be added to it.
unsubscribe = emitter.on(eventString, listenerFunction)
Adds an event listener function. Returns an unsubscribe function that, when called, prevents the listener from firing any more.
The listener function will be passed the optional argument that you passed into emit
, as well as an object with a stopPropagation
function that you can call to prevent any other listeners from getting the message.
unsubscribe = emitter.once(eventString, listenerFunction)
Just like the on
function, except the listener is automatically unsubscribed after the first time the event is emitted.
emitter.emit(eventString, [arg])
Calls all listeners of the given event string, with one optional argument.
emitter.removeAllListeners()
Unsubscribes all current event listeners.
FAQs
A very simple event emitter with a better API than all the others
The npm package better-emitter receives a total of 0 weekly downloads. As such, better-emitter popularity was classified as not popular.
We found that better-emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.