
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@atomico/channel
Advanced tools
@atomico/channel
allows sharing states between WebComponents or DOM easily.
This API is inspired by the objectives of React Context, but eliminates the complexity and is an agnostic implementation.
A channel is a sender and a receiver of status through the native event system of the DOM, a channel has the following logic:
This is an example where the webcomponent subscribes to the parent node:
import { Channel } from "@atomico/channel";
const CHANNEL = "MyChannel";
// Parent channel
const parentChannel = new Channel(document.body, CHANNEL);
class MyComponent extends HTMLElement {
constructor() {
super();
// Child channel
this.channel = new Channel(this, CHANNEL);
}
connectedcallback() {
this.channel.connected(
(data) => (this.textContent = JSON.stringify(data))
);
}
disconnectedCallback() {
this.channel.disconnect();
}
}
// Connect the channel to the native DOM event system
parentChannel.connect();
parentChannel.cast("I'm your father");
const channel = new Channel(
// Element
host,
// string
"idString",
// associates the composed option to the event
// this allows bypassing the shadowDOM when connecting the channels
true
);
channel.connect(optionalCallback);
Where:
optionalCallback
: optional callback that allows to read the transmissions of the parent.Remove subscriptions
Issues a new broadcast to the child channels
channel.cast(10);
channel.cast({ data });
Executing this method prevents any transmission from the parent from spreading to the children of this channel.
FAQs
sharing states between WebComponents or DOM easily.
The npm package @atomico/channel receives a total of 322 weekly downloads. As such, @atomico/channel popularity was classified as not popular.
We found that @atomico/channel 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.