Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@solid-primitives/event-listener
Advanced tools
A helpful event listener primitive that binds window and any element supplied.
createEventListener
- Very basic and straightforward primitive that handles multiple elements according to a single event binding.
const [add, remove] = createEventListener(document.getElementById("mybutton"), "mouseDown", () =>
console.log("Click")
);
// or as a directive
<MyButton use:createEventListener={() => ["click", () => console.log("Click")]}>Click!</MyButton>;
// you can provide your own event map type:
createEventListener<{ myCustomEvent: Event }>(window, "myCustomEvent", () => console.log("yup!"));
You may view a working example here: https://codesandbox.io/s/solid-primitives-event-listener-8mm77
0.0.100
First ported commit from react-use-event-listener.
1.1.4
Released a version with type mostly cleaned up.
1.2.3
Switched to a more idiomatic pattern: Warning: incompatible with the previous version!
FAQs
SolidJS Primitives to manage creating event listeners.
The npm package @solid-primitives/event-listener receives a total of 18,461 weekly downloads. As such, @solid-primitives/event-listener popularity was classified as popular.
We found that @solid-primitives/event-listener demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.