
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
event-plugin
Advanced tools
Declaratively add event listeners to your views. It can also delegate events to a parent element. It's a plugin for Seam.
npm install event-plugin
Require event-plugin:
var EventPlugin = require("event-plugin");
Init event plugin and define event handlers:
var eventPlugin = new EventPlugin({
toggle: function (event, node) {
// do something with...
// event is the original event
// node is the dom node that was clicked
}
});
<!-- The toggle function will be called on click, on the propagation phase -->
<button data-event="listen: click, toggle, true">Change route</button>
When ready, attach the behavior to the dom via Seam:
var Seam = require("seam");
var seam = new Seam({
event: eventPlugin
});
seam.apply(document.querySelector("button"));
You can also use the delegation method from event to delegate events to a parent DOM element. This improves performance are less event listeners are bound to the DOM. This is especially relevant to lists.
<!-- The ul will listen to click event and call the toggle handler if an element matching 'a' is targeted.
The bubbling phase will be listened to in this case -->
<ul data-event="delegate: a, click, toggle, false">
<li><a href="#link1">link1</a></li>
<li><a href="#link2">link2</a></li>
<li><a href="#link3">link3</a></li>
</ul>
MIT
FAQs
Declaratively add event listeners to your views.
The npm package event-plugin receives a total of 30 weekly downloads. As such, event-plugin popularity was classified as not popular.
We found that event-plugin 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.