@storybook/addon-notes
Advanced tools
Comparing version 3.2.0-alpha.10 to 3.2.0-alpha.13
@@ -20,6 +20,5 @@ 'use strict'; | ||
var withNotes = exports.withNotes = function withNotes(_ref) { | ||
var notes = _ref.notes; | ||
var withNotes = exports.withNotes = function withNotes(textOrOptions) { | ||
var channel = _addons2.default.getChannel(); | ||
var options = typeof textOrOptions === 'string' ? { text: textOrOptions } : textOrOptions; | ||
@@ -29,3 +28,3 @@ return function (getStory) { | ||
// send the notes to the channel before the story is rendered | ||
channel.emit('storybook/notes/add_notes', notes); | ||
channel.emit('storybook/notes/add_notes', options.text); | ||
return getStory(context); | ||
@@ -32,0 +31,0 @@ }; |
{ | ||
"name": "@storybook/addon-notes", | ||
"version": "3.2.0-alpha.10", | ||
"version": "3.2.0-alpha.13", | ||
"description": "Write notes for your Storybook stories.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,3 +40,3 @@ # Storybook Addon Notes | ||
storiesOf('Component', module) | ||
.add('with some emoji', withNotes({ notes: 'A very simple component'})(() => <Component></Component>)); | ||
.add('with some emoji', withNotes('A very simple component')(() => <Component></Component>)); | ||
``` |
@@ -5,8 +5,9 @@ import deprecate from 'util-deprecate'; | ||
export const withNotes = ({ notes }) => { | ||
export const withNotes = textOrOptions => { | ||
const channel = addons.getChannel(); | ||
const options = typeof textOrOptions === 'string' ? { text: textOrOptions } : textOrOptions; | ||
return getStory => context => { | ||
// send the notes to the channel before the story is rendered | ||
channel.emit('storybook/notes/add_notes', notes); | ||
channel.emit('storybook/notes/add_notes', options.text); | ||
return getStory(context); | ||
@@ -13,0 +14,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
174870
307