
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@cognite/storyhooks
Advanced tools
Storyhooks is a super tiny tool intended to make setup and mocking easier when writing stories in Storybook for React components.
Storyhooks is a super tiny tool intended to make setup and mocking easier when writing stories in Storybook for React components.
It is intended to emulate a beforeEach/afterEach workflow -- the didMount function is called when the child is being mounted, and the willUnmount function can be used to perform a teardown when the child is ready to be unmounted.
yarn add @cognite/storyhooks
or
npm i @cognite/storyhooks
To make use of StoryHooks in individual stories, start by importing it at the top of the file containing them:
import StoryHooks from '@cognite/storyhooks';
Pass in components as children of the StoryHooks component. Multiple children are supported. Check out stories/index.stories.tsx for more examples.
<StoryHooks
didMount={() => {
// This is a great place to perform setup actions, such as mocking out API calls performed by the component
sinon.stub(backend, 'fetchData').returns([{ id: 1, value: 'my data' }]);
}}
willUnmount={() => {
// This is a great place to perform teardown actions, such as:
sinon.restore();
}}
>
<MyAwesomeComponent />
<AnotherAwesomeComponent />
</StoryHooks>
Feel free to send us a PR.
By contributing you agree to abide by the Code of Conduct.
FAQs
Storyhooks is a super tiny tool intended to make setup and mocking easier when writing stories in Storybook for React components.
We found that @cognite/storyhooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 45 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.