-
Notifications
You must be signed in to change notification settings - Fork 94
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
Rework useStorageValue
to more simple and robust variant
#960
Conversation
BREAKING CHANGE: new implementation brings different API. It is not backward compatible!
Codecov Report
@@ Coverage Diff @@
## master #960 +/- ##
===========================================
- Coverage 100.00% 99.61% -0.39%
===========================================
Files 61 61
Lines 1065 1039 -26
Branches 184 165 -19
===========================================
- Hits 1065 1035 -30
- Misses 0 2 +2
- Partials 0 2 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@ArttuOll could you please finish this one? I think only docs left for now, the code itself and tests are already done. |
Sure! I'll take a look over the next few days. |
…e in documentation comment
# [16.0.0](v15.1.0...v16.0.0) (2022-10-09) ### Styles * remove I prefix from types and interfaces ([c2a1ff4](c2a1ff4)) ### BREAKING CHANGES * `I` prefix removed from all types having it.
) Bumps [jest-environment-jsdom](https://github.com/facebook/jest/tree/HEAD/packages/jest-environment-jsdom) from 29.1.2 to 29.2.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.0/packages/jest-environment-jsdom) --- updated-dependencies: - dependency-name: jest-environment-jsdom dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.1.2 to 29.2.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…967) Bumps [@react-hookz/eslint-config](https://github.com/react-hookz/eslint-config) from 1.7.3 to 1.7.4. - [Release notes](https://github.com/react-hookz/eslint-config/releases) - [Changelog](https://github.com/react-hookz/eslint-config/blob/master/CHANGELOG.md) - [Commits](react-hookz/eslint-config@v1.7.3...v1.7.4) --- updated-dependencies: - dependency-name: "@react-hookz/eslint-config" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together. Updates `jest` from 29.2.0 to 29.2.1 - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.1/packages/jest) Updates `@types/jest` from 29.1.2 to 29.2.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [jest-environment-jsdom](https://github.com/facebook/jest/tree/HEAD/packages/jest-environment-jsdom) from 29.2.0 to 29.2.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.1/packages/jest-environment-jsdom) --- updated-dependencies: - dependency-name: jest-environment-jsdom dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@storybook/storybook-deployer](https://github.com/storybooks/storybook-deployer) from 2.8.12 to 2.8.16. - [Release notes](https://github.com/storybooks/storybook-deployer/releases) - [Changelog](https://github.com/storybookjs/storybook-deployer/blob/master/CHANGELOG.md) - [Commits](storybook-eol/storybook-deployer@v2.8.12...v2.8.16) --- updated-dependencies: - dependency-name: "@storybook/storybook-deployer" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.3 to 7.19.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.19.6/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Conflicts: # CHANGELOG.md # package.json
@JoeDuncko @ArttuOll please review PR as a whole. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hook seems to work as expected.
One thing I noticed was that the code example does not show the usage of the hook itself; it just shows the rendered HTML. I could not figure out how to make it show the hook though.
I commented on a couple spots where the exhaustive-deps
lint rule seemed to be unnecessarily disabled, which I personally dislike a lot, but it does not really affect the functionality of the hook here.
There is barely possible example of As for |
Sorry, I think I was a bit unclear. I meant that the examples of |
Have no idea how to make storybook to better handle code preview =( |
We have other examples also where this is a problem. I was thinking of going over the docs some time and doing little improvements like this. I'll worry about this then. |
🎉 This PR is included in version 17.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
New hook has less options, now it is impossible to make hook isolated, all hooks listening same key are synchronised.
Also hook return signature changed to object instead of array, as it provides more obvious API.
close #959
fix #451