@storybook/channels
TypeScript icon, indicating that this package has built-in type declarations

8.0.5 • Public • Published

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) {}
}

For more information visit: storybook.js.org

Readme

Keywords

Package Sidebar

Install

npm i @storybook/channels

Weekly Downloads

12,324,930

Version

8.0.5

License

MIT

Unpacked Size

24.1 kB

Total Files

5

Last publish

Collaborators

  • yannbf
  • kasperpeulen
  • valentinpalkovic
  • jreinhold
  • shilman
  • ndelangen
  • hypnosphi
  • tmeasday
  • igor-dv