Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

@storybook/channels

Package Overview
Dependencies
3
Maintainers
5
Versions
1197
Issues
File Explorer

Advanced tools

@storybook/channels

Storybook Channel is similar to an EventEmitter. Channels are used with Storybook implementations to send/receive events between the Storybook Manager and the Storybook Renderer.

    6.5.16latest
    Github

Version published
Maintainers
5
Weekly downloads
10,126,496
increased by11.46%

Weekly downloads

Readme

Source

Storybook Channel

Storybook Channel is similar to an EventEmitter. Channels are used with Storybook implementations to send/receive events between the Storybook Manager and the Storybook Renderer.

class Channel { addListener(type, listener) {} addPeerListener(type, listener) {} // ignore events from itself emit(type, ...args) {} eventNames() {} listenerCount(type) {} listeners(type) {} on(type, listener) {} once(type, listener) {} prependListener(type, listener) {} prependOnceListener(type, listener) {} removeAllListeners(type) {} removeListener(type, listener) {} }

The channel takes a Transport object as a parameter which will be used to send/receive messages. The transport object should implement this interface.

class Transport { send(event) {} setHandler(handler) {} }

Currently, channels are baked into storybook implementations and therefore this module is not designed to be used directly by addon developers. When developing addons, use the getChannel method exported by @storybook/addons module. For this to work, Storybook implementations should use the setChannel method before loading addons.

import { addons } from '@storybook/addons'; const channel = addons.getChannel();

For more information visit: storybook.js.org

Keywords

FAQs

What is @storybook/channels?

Storybook Channel is similar to an EventEmitter. Channels are used with Storybook implementations to send/receive events between the Storybook Manager and the Storybook Renderer.

Is @storybook/channels popular?

The npm package @storybook/channels receives a total of 9,849,278 weekly downloads. As such, @storybook/channels popularity was classified as popular.

Is @storybook/channels well maintained?

We found that @storybook/channels demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 5 open source maintainers collaborating on the project.

Last updated on 26 Jan 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc