Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with addon-actions decorate #3705

Closed
murphyke opened this issue Jun 4, 2018 · 4 comments
Closed

Help with addon-actions decorate #3705

murphyke opened this issue Jun 4, 2018 · 4 comments

Comments

@murphyke
Copy link

murphyke commented Jun 4, 2018

The documentation on decorate (from addon-actions) is not clear to me.

The following line blows up with a TypeError: Object(...) is not a function error.

const stringifyDecorator = decorate([args => args.map(el => JSON.stringify(el, null, 2))]);

To elaborate on how the API of decorate is confusing to me, I don't understand the purpose of requiring an array of functions instead of just one function. My understanding is that the function is supposed to map the action arguments to whatever you want. And ... you can provide multiple such functions that are applied in succession to each others' output? Apologies if my caffeine dearth is making me slow-witted.

  • @storybook/react@3.4.6
  • @storybook/addon-actions@3.4.6
@stale
Copy link

stale bot commented Jun 25, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jun 25, 2018
@MIreland
Copy link

I'm seeing the same thing here- is the documentation up to date? I don't see 'decorate' as an available import from addon-actions.

@stale stale bot removed the inactive label Jul 12, 2018
@igor-dv
Copy link
Member

igor-dv commented Jul 12, 2018

decorate was introduced in v4-alpha and docs are relevant to the master branch which is a v4.

The 3.4 release is here - https://github.com/storybooks/storybook/tree/release/3.4

@MIreland
Copy link

Perfect! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants