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

Loaders not executing in Docs #15733

Closed
dexster opened this issue Aug 2, 2021 · 1 comment
Closed

Loaders not executing in Docs #15733

dexster opened this issue Aug 2, 2021 · 1 comment

Comments

@dexster
Copy link
Contributor

dexster commented Aug 2, 2021

Describe the bug
Loader functions do not run in Docs. They work fine in Canvas

To Reproduce

  1. ng new sbtest
  2. npx sb init in the sbtest directory

Add the loader to the Primary button story. Note the ts-ignore as loaders are not defined on the Story type

export const Primary = Template.bind({});
Primary.args = {
  primary: true,
  label: 'Button',
};
// @ts-ignore
Primary.loaders = [
  async () => ({
    todo: console.log('LOADING PRIMARY')
  })
];

Run this and the console will log for the Canvas tab but not the Docs tab.

I realise Loaders have always been flagged as experimental but is there another way to achieve this functionality if we cannot use Loaders?

System
I tested with 6.3.6 and 6.4.0-alpha.22. Both have this issue

@shilman
Copy link
Member

shilman commented Aug 2, 2021

closing as dupe to #12726

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

2 participants