How to use the @loki/integration-core.decorateStorybook function in @loki/integration-core

To help you get started, we’ve selected a few @loki/integration-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oblador / loki / packages / integration-react-native / src / configure-storybook-react-native.js View on Github external
async function configureStorybook() {
  injectLokiGlobalErrorHandler();

  // Decorate the storiesOf function to be able to skip stories
  const getStorybook = decorateStorybook(storybook);

  // Monkey patch `Image`
  Object.defineProperty(ReactNative, 'Image', {
    configurable: true,
    enumerable: true,
    get: () => require('./ready-state-emitting-image'),
  });

  const channel = await getAddonsChannel();
  const platform = ReactNative.Platform.OS;

  const on = (eventName, callback) =>
    channel.on(`${MESSAGE_PREFIX}${eventName}`, params => {
      if (params && params.platform === platform) {
        callback(params);
      }
github oblador / loki / packages / browser / src / configure-storybook.js View on Github external
return function configureStorybook() {
    if (typeof window === 'object') {
      if (!window.loki) {
        window.loki = {};
      }
      window.loki.getStorybook = decorateStorybook(storybook);
      window.loki.registerPendingPromise = registerPendingPromise;
      window.loki.resetPendingPromises = resetPendingPromises;
      window.loki.awaitReady = awaitReady;
    }
  };
}

@loki/integration-core

Loki storybook integration core lib

MIT
Latest version published 8 months ago

Package Health Score

71 / 100
Full package analysis

Popular @loki/integration-core functions