-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Running functions conditionally based on the story displayed. #290
Comments
Yes you are correct, |
Thank you for your help @arunoda - I successfully created an example here: https://gist.github.com/joscha/9e1d4eea6fddd50df25012d704180aa1 |
Okay. We are good here right :) |
Did this ever make it into Storybook @joscha ? |
@ndelangen the linked example was sufficient, so closing it is fine! 👍 |
I am currently trying to integrate https://github.com/mrdoob/stats.js in order to add a
addMonitored
method that would allow specifying a performance monitored story like this:I tried like this:
It kinda works:

however there are some flaws in that - the function passed to
this.add
gets called immediately and not only when that particular story is shown, hence the stats window is always visible. Also, the requestAnimationFrame is kicked off immediately. Potentially this could be done by wrappingstoryFn(context)
with a component that starts the stats on mount, but I am not sure how to achieve this. Any pointers?The text was updated successfully, but these errors were encountered: