Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Switch to use decorator API #74

Merged
merged 3 commits into from
Feb 4, 2019
Merged

Switch to use decorator API #74

merged 3 commits into from
Feb 4, 2019

Conversation

pocka
Copy link
Owner

@pocka pocka commented Feb 3, 2019

Use decorator API instead of manual decoration (component wrapping?).
Close #73

// before
storiesOf('...')
  .add('...', withInfo({
    // options here
  })(() => ({
    template: 'story'
  })))

// after
storiesOf('...')
  .addDecorator(withInfo)
  .add('...', () => ({
    template: 'story'
  }), {
    info: {
      // options here
    }
  })

This change enables us to work with addon-knobs (if you're using >= @storybook/[email protected]).

https://deploy-preview-74--storybook-addon-vue-info.netlify.com/?panelRight=1

pocka added 3 commits February 3, 2019 20:48
* Switch to use decorator API. With this change and @storybook/4.2, we
  can now work with addon-knobs!
@pocka pocka added enhancement v1 Version 1.x labels Feb 3, 2019
@pocka pocka self-assigned this Feb 3, 2019
@pocka
Copy link
Owner Author

pocka commented Feb 3, 2019

Build breaks due to yesterday release of Terser. (storybook -> webpack -> Terser)
Waiting for a new release...

@pocka pocka merged commit faed231 into release/v1.0 Feb 4, 2019
@pocka pocka deleted the feature/decorator-api branch February 4, 2019 12:18
This was referenced Feb 4, 2019
@blocka
Copy link

blocka commented Mar 26, 2019

When I do this TS complains because withInfo is not a StoryDecorator

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

Successfully merging this pull request may close these issues.

2 participants