A lightweight, type-safe, stateless event system for building reactive UIs. Designed to enable feature-level communication in large-scale applications using frameworks like React.
evit = event it!
@evit/core
)@evit/react
Core library:
npm install @evit/core
pnpm add @evit/core
yarn add @evit/core
React bindings:
You can also install react bindings @evit/react
.
import { defineEvent, withPayload } from '@evit/core'
// Define an event with a payload
const userCreated = defineEvent('user.created', withPayload<{ id: number }>())
// Subscribe to the event
userCreated.on((payload, tag) => {
console.log(payload.id) // → 123
})
// Trigger the event
userCreated({ id: 123 })
Package | Description |
---|---|
@evit/core |
Framework-agnostic core event system |
@evit/react |
React bindings (useEventEffect hook, etc.) |
MIT