#Installation
npm install @solid-primitives/event-props
yarn add @solid-primitives/event-props
pnpm add @solid-primitives/event-props
#Readme
A helpful primitive that creates the event props and a reactive store with the latest events
#How to use it
#createEventProps
Receive the event props and a props with the latest events:
const [events, eventProps] = createEventProps('mousedown', 'mousemove', 'mouseup');
const isMouseDown = createMemo(() => (events.mousedown?.ts ?? 0) > (events.mouseup?.ts ?? 1));
createEffect(() => {
if (isMouseDown()) {
console.log(events.mousemove?.clientX, events.mousemove?.clientY);
}
})
<div {...eventProps}>Click and drag on me</div>
#Demo
TODO
#Changelog
See CHANGELOG.md