mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-19 05:02:40 +08:00
Core: Rename load => configure
This commit is contained in:
parent
adef6bd2e3
commit
0ac48981fe
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
export { moduleMetadata } from './preview/angular/decorators';
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable prefer-destructuring */
|
||||
import { start } from '@storybook/core/client';
|
||||
import { ClientStoryApi } from '@storybook/addons';
|
||||
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
||||
|
||||
import './globals';
|
||||
import render from './render';
|
||||
@ -10,7 +10,7 @@ const framework = 'angular';
|
||||
|
||||
interface ClientApi extends ClientStoryApi<StoryFnAngularReturnType> {
|
||||
setAddon(addon: any): void;
|
||||
configure(loaders: () => void, module: NodeModule): void;
|
||||
configure(loader: Loadable, module: NodeModule, framework: string): void;
|
||||
getStorybook(): IStorybookSection[];
|
||||
clearDecorators(): void;
|
||||
forceReRender(): void;
|
||||
@ -26,12 +26,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
|
||||
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
|
||||
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
|
||||
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
|
||||
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
|
||||
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
|
||||
export const configure: ClientApi['configure'] = api.configApi.configure;
|
||||
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
|
||||
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
|
||||
export const raw: ClientApi['raw'] = api.clientApi.raw;
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'ember';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable prefer-destructuring */
|
||||
import { start } from '@storybook/core/client';
|
||||
import { ClientStoryApi } from '@storybook/addons';
|
||||
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
||||
|
||||
import './globals';
|
||||
import render from './render';
|
||||
@ -10,12 +10,11 @@ const framework = 'html';
|
||||
|
||||
interface ClientApi extends ClientStoryApi<StoryFnHtmlReturnType> {
|
||||
setAddon(addon: any): void;
|
||||
configure(loaders: () => void, module: NodeModule): void;
|
||||
configure(loader: Loadable, module: NodeModule, framework: string): void;
|
||||
getStorybook(): IStorybookSection[];
|
||||
clearDecorators(): void;
|
||||
forceReRender(): void;
|
||||
raw: () => any; // todo add type
|
||||
load: (req: any, m: NodeModule, framework: string) => void;
|
||||
}
|
||||
|
||||
const api = start(render);
|
||||
@ -26,12 +25,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
|
||||
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
|
||||
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
|
||||
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
|
||||
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
|
||||
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
|
||||
export const configure: ClientApi['configure'] = api.configApi.configure;
|
||||
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
|
||||
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
|
||||
export const raw: ClientApi['raw'] = api.clientApi.raw;
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'marko';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'mithril';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'polymer';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,5 +7,4 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'preact';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,5 +7,4 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'rax';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
raw,
|
||||
forceReRender,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable prefer-destructuring */
|
||||
import { start } from '@storybook/core/client';
|
||||
import { ClientStoryApi } from '@storybook/addons';
|
||||
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
||||
|
||||
import './globals';
|
||||
import render from './render';
|
||||
@ -10,12 +10,11 @@ const framework = 'react';
|
||||
|
||||
interface ClientApi extends ClientStoryApi<StoryFnReactReturnType> {
|
||||
setAddon(addon: any): void;
|
||||
configure(loaders: () => void, module: NodeModule): void;
|
||||
configure(loader: Loadable, module: NodeModule, framework: string): void;
|
||||
getStorybook(): IStorybookSection[];
|
||||
clearDecorators(): void;
|
||||
forceReRender(): void;
|
||||
raw: () => any; // todo add type
|
||||
load: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
const api = start(render);
|
||||
@ -26,12 +25,11 @@ export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const load: ClientApi['load'] = (...args) => api.load(...args, framework);
|
||||
export const configure: ClientApi['configure'] = (...args) => api.configure(...args, framework);
|
||||
export const addDecorator: ClientApi['addDecorator'] = api.clientApi.addDecorator;
|
||||
export const addParameters: ClientApi['addParameters'] = api.clientApi.addParameters;
|
||||
export const clearDecorators: ClientApi['clearDecorators'] = api.clientApi.clearDecorators;
|
||||
export const setAddon: ClientApi['setAddon'] = api.clientApi.setAddon;
|
||||
export const configure: ClientApi['configure'] = api.configApi.configure;
|
||||
export const forceReRender: ClientApi['forceReRender'] = api.forceReRender;
|
||||
export const getStorybook: ClientApi['getStorybook'] = api.clientApi.getStorybook;
|
||||
export const raw: ClientApi['raw'] = api.clientApi.raw;
|
||||
|
@ -12,7 +12,6 @@ export {
|
||||
compileNow,
|
||||
asCompiledCode,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -5,7 +5,7 @@ import riot, { tag2, mount as vendorMount } from 'riot';
|
||||
import render from './render';
|
||||
import { compileNow as unboundCompileNow, asCompiledCode } from './compileStageFunctions';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -18,9 +18,8 @@ export const {
|
||||
|
||||
const framework = 'riot';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
const mount = vendorMount.bind(riot, '#root');
|
||||
const compileNow = unboundCompileNow.bind(null, tag2);
|
||||
export { forceReRender, render, tag2 as tag, mount, compileNow, asCompiledCode };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -3,7 +3,7 @@ import { start } from '@storybook/core/client';
|
||||
import './globals';
|
||||
import render from './render';
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render);
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render);
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -16,7 +16,6 @@ export const {
|
||||
|
||||
const framework = 'svelte';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -7,7 +7,6 @@ export {
|
||||
getStorybook,
|
||||
forceReRender,
|
||||
raw,
|
||||
load,
|
||||
} from './preview';
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
|
@ -75,7 +75,9 @@ function decorateStory(getStory, decorators) {
|
||||
);
|
||||
}
|
||||
|
||||
const { load: coreLoad, clientApi, configApi, forceReRender } = start(render, { decorateStory });
|
||||
const { configure: coreConfigure, clientApi, forceReRender } = start(render, {
|
||||
decorateStory,
|
||||
});
|
||||
|
||||
export const {
|
||||
setAddon,
|
||||
@ -88,7 +90,6 @@ export const {
|
||||
|
||||
const framework = 'vue';
|
||||
export const storiesOf = (...args) => clientApi.storiesOf(...args).addParameters({ framework });
|
||||
export const load = (...args) => coreLoad(...args, framework);
|
||||
export const configure = (...args) => coreConfigure(...args, framework);
|
||||
|
||||
export const { configure } = configApi;
|
||||
export { forceReRender };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/ember';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/ember';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -9,4 +9,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/html';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/html';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
import { DocsPage } from '@storybook/addon-docs/blocks';
|
||||
|
||||
@ -21,4 +21,4 @@ addParameters({
|
||||
docs: DocsPage,
|
||||
});
|
||||
|
||||
load(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);
|
||||
configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/marko';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/marko';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -8,4 +8,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/mithril';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/mithril';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -8,4 +8,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { load, addDecorator, addParameters } from '@storybook/react';
|
||||
import { configure, addDecorator, addParameters } from '@storybook/react';
|
||||
import { Global, ThemeProvider, themes, createReset, convert } from '@storybook/theming';
|
||||
import { DocsPage } from '@storybook/addon-docs/blocks';
|
||||
|
||||
@ -60,7 +60,7 @@ addParameters({
|
||||
docs: DocsPage,
|
||||
});
|
||||
|
||||
load(
|
||||
configure(
|
||||
[
|
||||
require.context('../../lib/ui/src', true, /\.stories\.(js|tsx?|mdx)$/),
|
||||
require.context('../../lib/components/src', true, /\.stories\.(js|tsx?|mdx)$/),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/polymer';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/polymer';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -8,4 +8,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/** @jsx h */
|
||||
import { load, addParameters, addDecorator } from '@storybook/preact';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/preact';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -10,4 +10,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters } from '@storybook/rax';
|
||||
import { configure, addParameters } from '@storybook/rax';
|
||||
|
||||
addParameters({
|
||||
options: {
|
||||
@ -15,4 +15,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/riot';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/riot';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -8,4 +8,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/svelte';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/svelte';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
|
||||
addDecorator(withA11y);
|
||||
@ -8,4 +8,4 @@ addParameters({
|
||||
},
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { load, addParameters, addDecorator } from '@storybook/vue';
|
||||
import { configure, addParameters, addDecorator } from '@storybook/vue';
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
@ -20,4 +20,4 @@ addParameters({
|
||||
docs: DocsPage,
|
||||
});
|
||||
|
||||
load(require.context('../src/stories', true, /\.stories\.(js|mdx)$/), module);
|
||||
configure(require.context('../src/stories', true, /\.stories\.(js|mdx)$/), module);
|
||||
|
@ -93,3 +93,7 @@ export interface ClientStoryApi<TApi> {
|
||||
addDecorator(decorator: DecoratorFunction): StoryApi<TApi>;
|
||||
addParameters(parameter: Parameters): StoryApi<TApi>;
|
||||
}
|
||||
|
||||
type LoadFn = () => any;
|
||||
type RequireContext = any; // FIXME
|
||||
export type Loadable = RequireContext | [RequireContext] | LoadFn;
|
||||
|
@ -58,6 +58,7 @@ export interface LegacyData {
|
||||
export interface ClientApiAddon<TApi = unknown> extends Addon {
|
||||
apply: (a: StoryApi<TApi>, b: any[]) => any;
|
||||
}
|
||||
|
||||
export interface ClientApiAddons<TApi> {
|
||||
[key: string]: ClientApiAddon<TApi>;
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ export default function start(render, { decorateStory } = {}) {
|
||||
* @param {*} m - ES module object for hot-module-reloading (HMR)
|
||||
* @param {*} framework - name of framework in use, e.g. "react"
|
||||
*/
|
||||
const load = (loadable, m, framework) => {
|
||||
const configure = (loadable, m, framework) => {
|
||||
if (m && m.hot && m.hot.dispose) {
|
||||
({ previousExports = new Set() } = m.hot.data || {});
|
||||
|
||||
@ -423,5 +423,5 @@ export default function start(render, { decorateStory } = {}) {
|
||||
configApi.configure(loadStories(loadable, framework), m);
|
||||
};
|
||||
|
||||
return { load, context, clientApi, configApi, forceReRender };
|
||||
return { configure, context, clientApi, configApi, forceReRender };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user