Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@storybook/core-events
Advanced tools
@storybook/core-events is a package that provides a set of core events for Storybook, a tool for developing UI components in isolation. These events facilitate communication between different parts of Storybook, such as the manager and the preview, enabling features like story selection, control updates, and more.
Story Selection
This feature allows you to programmatically select a story in Storybook. The code sample demonstrates how to emit a story selection event using the SELECT_STORY event type.
const { SELECT_STORY } = require('@storybook/core-events');
// Example of emitting a story selection event
const channel = addons.getChannel();
channel.emit(SELECT_STORY, { kind: 'Button', story: 'Primary' });
Control Updates
This feature allows you to update the controls (args) of a story. The code sample shows how to emit an event to update the arguments of a specific story using the UPDATE_STORY_ARGS event type.
const { UPDATE_STORY_ARGS } = require('@storybook/core-events');
// Example of emitting a control update event
const channel = addons.getChannel();
channel.emit(UPDATE_STORY_ARGS, { storyId: 'button--primary', updatedArgs: { label: 'Click Me' } });
Story Rendering
This feature allows you to listen for when a story has been rendered. The code sample demonstrates how to listen for the STORY_RENDERED event and log a message when a story is rendered.
const { STORY_RENDERED } = require('@storybook/core-events');
// Example of listening for a story rendered event
const channel = addons.getChannel();
channel.on(STORY_RENDERED, (storyId) => {
console.log(`Story ${storyId} has been rendered`);
});
EventEmitter3 is a high-performance event emitter for Node.js and the browser. It provides a similar event-driven architecture but is more general-purpose compared to @storybook/core-events, which is specifically designed for Storybook.
Mitt is a tiny functional event emitter. It offers a similar event-driven approach but is lightweight and framework-agnostic, making it suitable for a wide range of applications beyond Storybook.
Node Event Emitter is a simple and lightweight event emitter for Node.js. It provides basic event handling capabilities similar to @storybook/core-events but lacks the specialized events tailored for Storybook's ecosystem.
7.0.0-beta.31 (January 20, 2023)
ArgTypes
component and stories #20664context.resolveOf
#20662FAQs
Event names used in storybook core
The npm package @storybook/core-events receives a total of 6,122,317 weekly downloads. As such, @storybook/core-events popularity was classified as popular.
We found that @storybook/core-events demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.