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

Scope mockData to each story #179

Open
cernymatej opened this issue Jul 18, 2023 · 0 comments
Open

Scope mockData to each story #179

cernymatej opened this issue Jul 18, 2023 · 0 comments

Comments

@cernymatej
Copy link

I've noticed that when 2 stories make the same request & I define a big delay, for example, on one of the mock requests, the one that belongs to the first story to be exported is used.

export const FirstStory = {
    parameters: {
        mockData: [
            {
             ...
             delay: 0,
             }
         ]
     }
}

export const LoadingStory = {
    parameters: {
        mockData: [
            {
             ...
             delay: 99999,
             }
         ]
     }
}


// there is no delay for the LoadingStory - if rendered in the <Stories /> doc block
// (works fine when rendered on its own of course)

PS: it would also be nice to have an "infinite" delay option - so that it is easier to show the loading states of components without needing to rely on a big delay integer

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

No branches or pull requests

1 participant