Norbert de Langen 25a70a48e9 FIX issue with event being undefined
I don't know why the event data is undefined, but whatever, that can happen to anyone. Someone's you feel like undefined
You just have to hang on and wait for better times. You can't always win.

Sure I could filter out the undefined, but let's be real, don't hide the undefined, just let it be. It will pass.
2019-04-05 11:10:16 +02:00
..
2019-04-05 11:10:16 +02:00
2019-04-04 23:31:16 +08:00
2018-07-31 19:34:05 +03:00
2018-12-24 01:41:15 +01:00

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