diff --git a/.storybook/stories.js b/.storybook/stories.js
index 16949447c9e3..a74042267160 100644
--- a/.storybook/stories.js
+++ b/.storybook/stories.js
@@ -8,4 +8,17 @@ storiesOf('Button', module)
))
.add('Second Story', () => (
+ ))
+ .add('Multiple Selection', () => (
+ {
+ return filter === 'First' ? 'First Story' : 'Second Story';
+ })}/>
));
+
+const MultipleStories = ({onClick}) => {
+ return (
+
+
+
+
);
+}
diff --git a/dist/preview.js b/dist/preview.js
index 7531aa0ef918..40c3e06b8cf7 100644
--- a/dist/preview.js
+++ b/dist/preview.js
@@ -15,7 +15,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function linkTo(kind, story) {
return function () {
+ var resolvedKind = typeof kind === 'function' ? kind.apply(undefined, arguments) : kind;
+ var resolvedStory = typeof story === 'function' ? story.apply(undefined, arguments) : story;
+
var channel = _storybookAddons2.default.getChannel();
- channel.emit(_.EVENT_ID, { kind: kind, story: story });
+ console.log(resolvedKind);
+ channel.emit(_.EVENT_ID, { kind: resolvedKind, story: resolvedStory });
};
}
\ No newline at end of file
diff --git a/src/preview.js b/src/preview.js
index 20dd49b5c6a0..6ba1f2e3aa37 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -2,8 +2,11 @@ import addons from '@kadira/storybook-addons';
import { EVENT_ID } from './';
export function linkTo(kind, story) {
- return function () {
+ return function (...args) {
+ const resolvedKind = typeof kind === 'function' ? kind(...args) : kind;
+ const resolvedStory = typeof story === 'function' ? story(...args) : story;
+
const channel = addons.getChannel();
- channel.emit(EVENT_ID, {kind, story});
+ channel.emit(EVENT_ID, {kind: resolvedKind, story: resolvedStory});
};
}