
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
stimulus-events
Advanced tools
Stimulus events is a simple Typescript library that uses the power of decorators to easily create an easy eventing system for communication between your different Stimulus controllers.
Never forget to call and manage removeEventListener
on disconnect()
again!
First, let's define an Events.ts
file for our event constants! Helps us keep track
of what's out there.
export const UserCountChanged = "UserCountChanged"
This isn't strictly necessary, but it helps keep your code more maintainable and is highly recommended.
import {UserCountChanged} from './Events';
class MyController extends Controller {
@subscribeTo(UserCountChanged)
updateUserCount(payload: Payload) {
let {count} = payload
// And yer off!
// We'll automatically subscribe on connect() and unsubscribe on disconnect()
}
}
And, triggering this from anywhere in your application is as easy as...
MainBus.send(UserCountChanged, {count: 3})
BOOM! That's it. All done. Time for a tea break.
FAQs
Stimulus Event System
The npm package stimulus-events receives a total of 1 weekly downloads. As such, stimulus-events popularity was classified as not popular.
We found that stimulus-events 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.