@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.
Last updated 5 years ago by shilman .
MIT · Repository · Bugs · Original npm
$ cnpm install @storybook/channels 
SYNC missed versions from official npm registry.

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

Current Tags

  • 7.1.0-alpha.29                                ...           future (2 years ago)
  • 7.0.27                                ...           latest (2 years ago)
  • 7.1.0-rc.1                                ...           next (2 years ago)
  • 6.5.17-alpha.0                                ...           prerelease (2 years ago)

48 Versions

  • 7.1.0-rc.1                                ...           2 years ago
  • 7.0.27                                ...           2 years ago
  • 7.0.0-alpha.10                                ...           3 years ago
  • 6.5.17-alpha.0                                ...           2 years ago
  • 7.1.0-beta.0                                ...           2 years ago
  • 7.0.26                                ...           2 years ago
  • 7.1.0-alpha.29                                ...           2 years ago
  • 6.5.16                                ...           3 years ago
  • 6.5.9-alpha.2                                ...           3 years ago
  • 7.0.0-alpha.2                                ...           3 years ago
  • 6.5.9                                ...           3 years ago
  • 5.3.22                                ...           4 years ago
  • 6.5.5                                ...           3 years ago
  • 6.5.5-alpha.3                                ...           3 years ago
  • 6.5.0-rc.1                                ...           3 years ago
  • 6.5.4                                ...           3 years ago
  • 6.5.0-alpha.48                                ...           3 years ago
  • 6.5.0-beta.7                                ...           3 years ago
  • 6.5.0-beta.8                                ...           3 years ago
  • 6.4.22                                ...           3 years ago
  • 6.5.0-alpha.38                                ...           4 years ago
  • 6.4.18                                ...           4 years ago
  • 6.5.0-alpha.22                                ...           4 years ago
  • 6.4.14                                ...           4 years ago
  • 6.5.0-alpha.17                                ...           4 years ago
  • 6.5.0-alpha.18                                ...           4 years ago
  • 6.4.13                                ...           4 years ago
  • 6.4.12                                ...           4 years ago
  • 6.4.0-alpha.35                                ...           4 years ago
  • 6.4.0-alpha.27                                ...           4 years ago
  • 6.4.0-beta.0                                ...           4 years ago
  • 6.4.0-alpha.34                                ...           4 years ago
  • 6.3.8                                ...           4 years ago
  • 6.4.0-alpha.30                                ...           4 years ago
  • 6.3.7                                ...           4 years ago
  • 6.2.0-alpha.10                                ...           5 years ago
  • 6.0.28-alpha.3                                ...           5 years ago
  • 6.1.11                                ...           5 years ago
  • 6.1.0-alpha.9                                ...           5 years ago
  • 5.3.21                                ...           5 years ago
  • 6.1.0-alpha.3                                ...           5 years ago
  • 6.0.21                                ...           5 years ago
  • 6.0.0-alpha.29                                ...           5 years ago
  • 6.0.0-alpha.6                                ...           6 years ago
  • 6.0.0-alpha.2                                ...           6 years ago
  • 6.0.0-beta.27                                ...           5 years ago
  • 5.3.19                                ...           5 years ago
  • 5.3.18                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org