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
fix(docs): Add Slices pattern example #1485
Conversation
By ading this example we can combine the real Slices pattern implementation (instead of multiple stores) with the resetAll method. Hope this helps! 😄
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 260f146:
|
@chrisk-7777 can you review this? (slice pattern might not still be 100% stable.) |
@sewera whenever you have time. |
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.
Not a real review, but I can drop in with some easy, actionable tasks while on my phone:
- Please align the code style with the one in the Zustand code base.
- Please remove the comments. They are redundant, as the variable names provide sufficient documentation. If you feel, however, that the code blocks could be named, consider extracting functions for them. I don't feel that's justified here, though.
Hi @jmantonellini, what's the status of this PR? Do we continue with it? I didn't put any other comments, Anyway, please let me know if this PR is still relevant :) |
Hi @sewera ! Thank you for reviewing this. I commited the changes that you requested. |
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.
Apart from the comments in code, this looks about right.
Last changes already pushed ✅ Should be good to go now @sewera |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^18.14.0` -> `^18.15.3`](https://renovatebot.com/diffs/npm/@types%2fnode/18.14.0/18.15.3) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.15.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.15.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.15.3/compatibility-slim/18.14.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.15.3/confidence-slim/18.14.0)](https://docs.renovatebot.com/merge-confidence/) | | [eslint](https://eslint.org) ([source](https://togithub.com/eslint/eslint)) | [`^8.34.0` -> `^8.36.0`](https://renovatebot.com/diffs/npm/eslint/8.34.0/8.36.0) | [![age](https://badges.renovateapi.com/packages/npm/eslint/8.36.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/eslint/8.36.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/eslint/8.36.0/compatibility-slim/8.34.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/eslint/8.36.0/confidence-slim/8.34.0)](https://docs.renovatebot.com/merge-confidence/) | | [vite](https://togithub.com/vitejs/vite/tree/main/#readme) ([source](https://togithub.com/vitejs/vite)) | [`^4.1.3` -> `^4.1.4`](https://renovatebot.com/diffs/npm/vite/4.1.3/4.1.4) | [![age](https://badges.renovateapi.com/packages/npm/vite/4.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/vite/4.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/vite/4.1.4/compatibility-slim/4.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/vite/4.1.4/confidence-slim/4.1.3)](https://docs.renovatebot.com/merge-confidence/) | | [zustand](https://togithub.com/pmndrs/zustand) | [`^4.3.3` -> `^4.3.6`](https://renovatebot.com/diffs/npm/zustand/4.3.3/4.3.6) | [![age](https://badges.renovateapi.com/packages/npm/zustand/4.3.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/zustand/4.3.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/zustand/4.3.6/compatibility-slim/4.3.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/zustand/4.3.6/confidence-slim/4.3.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>eslint/eslint</summary> ### [`v8.36.0`](https://togithub.com/eslint/eslint/releases/tag/v8.36.0) [Compare Source](https://togithub.com/eslint/eslint/compare/v8.35.0...v8.36.0) #### Features - [`c89a485`](https://togithub.com/eslint/eslint/commit/c89a485c49450532ee3db74f2638429f1f37d0dd) feat: Add `checkJSDoc` option to multiline-comment-style ([#​16807](https://togithub.com/eslint/eslint/issues/16807)) (Laurent Cozic) - [`f5f5e11`](https://togithub.com/eslint/eslint/commit/f5f5e11bd5fd3daab9ccae41e270739c836c305e) feat: Serialize parsers/processors in flat config ([#​16944](https://togithub.com/eslint/eslint/issues/16944)) (Nicholas C. Zakas) - [`4799297`](https://togithub.com/eslint/eslint/commit/4799297ea582c81fd1e5623d32a7ddf7a7f3a126) feat: use [@​eslint-community](https://togithub.com/eslint-community) dependencies ([#​16784](https://togithub.com/eslint/eslint/issues/16784)) (Michaël De Boey) #### Bug Fixes - [`92c1943`](https://togithub.com/eslint/eslint/commit/92c1943ba73ea01e87086236e8736539b0eed558) fix: correctly iterate files matched by glob patterns ([#​16831](https://togithub.com/eslint/eslint/issues/16831)) (Nitin Kumar) #### Documentation - [`b98fdd4`](https://togithub.com/eslint/eslint/commit/b98fdd413a3b07b262bfce6f704c1c1bb8582770) docs: Update README (GitHub Actions Bot) - [`caf08ce`](https://togithub.com/eslint/eslint/commit/caf08ce0cc74917f7c0eec92d25fd784dc33ac4d) docs: fix estree link in custom formatters docs ([#​16967](https://togithub.com/eslint/eslint/issues/16967)) (Milos Djermanovic) - [`3398431`](https://togithub.com/eslint/eslint/commit/3398431574b903757bc78b08c8ed36b7b9fce8eb) docs: Custom Parsers cleanup/expansion ([#​16887](https://togithub.com/eslint/eslint/issues/16887)) (Ben Perlmutter) - [`19d3531`](https://togithub.com/eslint/eslint/commit/19d3531d9b54e1004318d28f9a6e18305c5bcc18) docs: Update README (GitHub Actions Bot) - [`b09a512`](https://togithub.com/eslint/eslint/commit/b09a512107249a4eb19ef5a37b0bd672266eafdb) docs: detect and fix broken links ([#​16837](https://togithub.com/eslint/eslint/issues/16837)) (Nitin Kumar) #### Chores - [`602b111`](https://togithub.com/eslint/eslint/commit/602b11121910a97ab2bc4a95a46dd0ccd0a89309) chore: upgrade [@​eslint/js](https://togithub.com/eslint/js)[@​8](https://togithub.com/8).36.0 ([#​16978](https://togithub.com/eslint/eslint/issues/16978)) (Milos Djermanovic) - [`43c2345`](https://togithub.com/eslint/eslint/commit/43c2345c27024aeab6127e6bbfd55c8b70bd317e) chore: package.json update for [@​eslint/js](https://togithub.com/eslint/js) release (ESLint Jenkins) - [`00afb84`](https://togithub.com/eslint/eslint/commit/00afb84e5039874c8745a45c953fceaf0c71c454) chore: upgrade [@​eslint/eslintrc](https://togithub.com/eslint/eslintrc)[@​2](https://togithub.com/2).0.1 ([#​16977](https://togithub.com/eslint/eslint/issues/16977)) (Milos Djermanovic) - [`698c5aa`](https://togithub.com/eslint/eslint/commit/698c5aad50e628ff00281dbc786e42de79834035) chore: upgrade espree@9.5.0 ([#​16976](https://togithub.com/eslint/eslint/issues/16976)) (Milos Djermanovic) - [`75acdd2`](https://togithub.com/eslint/eslint/commit/75acdd21c5ce7024252e9d41ed77d2f30587caac) chore: lint more js files in docs ([#​16964](https://togithub.com/eslint/eslint/issues/16964)) (Milos Djermanovic) - [`89d9844`](https://togithub.com/eslint/eslint/commit/89d9844b3151f09b5b21b6eeeda671009ec301e9) ci: bump actions/add-to-project from 0.4.0 to 0.4.1 ([#​16943](https://togithub.com/eslint/eslint/issues/16943)) (dependabot\[bot]) ### [`v8.35.0`](https://togithub.com/eslint/eslint/releases/tag/v8.35.0) [Compare Source](https://togithub.com/eslint/eslint/compare/v8.34.0...v8.35.0) #### Features - [`8e34a04`](https://togithub.com/eslint/eslint/commit/8e34a04e3a4395bce59bc6acadf84281abc11d18) feat: add `afterHashbangComment` option to `lines-around-comment` rule ([#​16920](https://togithub.com/eslint/eslint/issues/16920)) (SUZUKI Sosuke) - [`c8c0c71`](https://togithub.com/eslint/eslint/commit/c8c0c715a2964cc1859b99f9d4f542675094d1d5) feat: Move all and recommended configs into package. ([#​16844](https://togithub.com/eslint/eslint/issues/16844)) (Nicholas C. Zakas) - [`71f6f0d`](https://togithub.com/eslint/eslint/commit/71f6f0dcd574320ee71c3eb1f313841899bdf260) feat: report more cases with `??` in no-constant-binary-expression ([#​16826](https://togithub.com/eslint/eslint/issues/16826)) (Daiki Nishikawa) #### Bug Fixes - [`9698bc5`](https://togithub.com/eslint/eslint/commit/9698bc5cdec1bbee567a6a489da82e87fe65d019) fix: pin esquery v1.4.0 (fixes [#​16896](https://togithub.com/eslint/eslint/issues/16896)) ([#​16897](https://togithub.com/eslint/eslint/issues/16897)) (唯然) #### Documentation - [`f9f195e`](https://togithub.com/eslint/eslint/commit/f9f195ef12deb114fb86763010a23ea0cb4c78d1) docs: Plugin docs cleanup & expansion ([#​16862](https://togithub.com/eslint/eslint/issues/16862)) (Ben Perlmutter) - [`df809fd`](https://togithub.com/eslint/eslint/commit/df809fdedc5fc92df4be8340e28baedbde605b4f) docs: Custom Formatters page cleanup/expansion ([#​16886](https://togithub.com/eslint/eslint/issues/16886)) (Ben Perlmutter) - [`0700d1b`](https://togithub.com/eslint/eslint/commit/0700d1b14659bf39b1a08f082c44c9084cf676a8) docs: Add PostCSS/Autoprefixer/CSSNano ([#​16502](https://togithub.com/eslint/eslint/issues/16502)) (Nick Schonning) - [`7b9e9bf`](https://togithub.com/eslint/eslint/commit/7b9e9bf78bedb009fe2813308ede1f46502c3890) docs: support unicode anchors ([#​16782](https://togithub.com/eslint/eslint/issues/16782)) (Percy Ma) - [`5fbc0bf`](https://togithub.com/eslint/eslint/commit/5fbc0bffdd9f84feb43296eb502d1e484fb323f2) docs: Update README (GitHub Actions Bot) - [`67865a0`](https://togithub.com/eslint/eslint/commit/67865a064cc1a4e320030299edc1cfdd1f9ac3b8) docs: Remove mention of mailing list ([#​16869](https://togithub.com/eslint/eslint/issues/16869)) (Amaresh S M) - [`43af24a`](https://togithub.com/eslint/eslint/commit/43af24a88b939a62880c37d1332b02f677d82f16) docs: Add explanation of when to use 'warn' severity ([#​16882](https://togithub.com/eslint/eslint/issues/16882)) (Nicholas C. Zakas) - [`ed2999b`](https://togithub.com/eslint/eslint/commit/ed2999b38b4d61f5c278301738e294012d5d3c9e) docs: Shareable configs page edits and expansion ([#​16824](https://togithub.com/eslint/eslint/issues/16824)) (Ben Perlmutter) - [`2780635`](https://togithub.com/eslint/eslint/commit/27806358b5e1c4d37b63b1c61595e86ff03b5b42) docs: fix typos ([#​16884](https://togithub.com/eslint/eslint/issues/16884)) (Lioness100) - [`5bdaae2`](https://togithub.com/eslint/eslint/commit/5bdaae205c3a0089ea338b382df59e21d5b06436) docs: Ways to Extend ESLint page ([#​16861](https://togithub.com/eslint/eslint/issues/16861)) (Ben Perlmutter) #### Chores - [`cdcbe12`](https://togithub.com/eslint/eslint/commit/cdcbe127de20cbcc4e24131a808c13b1024e61a2) chore: upgrade [@​eslint/js](https://togithub.com/eslint/js)[@​8](https://togithub.com/8).35.0 ([#​16935](https://togithub.com/eslint/eslint/issues/16935)) (Brandon Mills) - [`c954c34`](https://togithub.com/eslint/eslint/commit/c954c349c0c2f88919614efc95e1368c245582fd) chore: package.json update for [@​eslint/js](https://togithub.com/eslint/js) release (ESLint Jenkins) - [`5a517da`](https://togithub.com/eslint/eslint/commit/5a517da8e55f6de28e9c028c5627fa7d82945969) chore: package.json update for [@​eslint/js](https://togithub.com/eslint/js) release (ESLint Jenkins) - [`9f10926`](https://togithub.com/eslint/eslint/commit/9f10926d76be7cf675721b29bd5030e85cb4ab30) chore: upgrade [@​eslint/eslintrc](https://togithub.com/eslint/eslintrc)[@​2](https://togithub.com/2).0.0 ([#​16928](https://togithub.com/eslint/eslint/issues/16928)) (Milos Djermanovic) - [`da728fa`](https://togithub.com/eslint/eslint/commit/da728fae6c4e5fdda74195e84d45d67ad5cafc45) ci: use LTS node version in workflows ([#​16907](https://togithub.com/eslint/eslint/issues/16907)) (Nitin Kumar) - [`c57b4f3`](https://togithub.com/eslint/eslint/commit/c57b4f3dc6383e452120381204ee4a7c874225a0) perf: upgrade to esquery@1.4.2 ([#​16901](https://togithub.com/eslint/eslint/issues/16901)) (Milos Djermanovic) - [`9122f07`](https://togithub.com/eslint/eslint/commit/9122f0764031dc36970df715bc5e16973890e18d) chore: Update stale bot settings ([#​16870](https://togithub.com/eslint/eslint/issues/16870)) (Nicholas C. Zakas) </details> <details> <summary>vitejs/vite</summary> ### [`v4.1.4`](https://togithub.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small414-2023-02-21-small) [Compare Source](https://togithub.com/vitejs/vite/compare/v4.1.3...v4.1.4) - fix(define): should not stringify vite internal env ([#​12120](https://togithub.com/vitejs/vite/issues/12120)) ([73c3999](https://togithub.com/vitejs/vite/commit/73c3999)), closes [#​12120](https://togithub.com/vitejs/vite/issues/12120) - docs: update rollup docs links ([#​12130](https://togithub.com/vitejs/vite/issues/12130)) ([439a73f](https://togithub.com/vitejs/vite/commit/439a73f)), closes [#​12130](https://togithub.com/vitejs/vite/issues/12130) </details> <details> <summary>pmndrs/zustand</summary> ### [`v4.3.6`](https://togithub.com/pmndrs/zustand/releases/tag/v4.3.6) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.3.5...v4.3.6) This has a little improvement for library authors. #### What's Changed - fix(react, types): relax react types by [@​lukesmurray](https://togithub.com/lukesmurray) in [pmndrs/zustand#1589 - fix: typo in shallow.ts by [@​ysulyma](https://togithub.com/ysulyma) in [pmndrs/zustand#1667 #### New Contributors - [@​ctolmsted](https://togithub.com/ctolmsted) made their first contribution in [pmndrs/zustand#1670 - [@​kevin51jiang](https://togithub.com/kevin51jiang) made their first contribution in [pmndrs/zustand#1674 - [@​lukesmurray](https://togithub.com/lukesmurray) made their first contribution in [pmndrs/zustand#1589 - [@​ysulyma](https://togithub.com/ysulyma) made their first contribution in [pmndrs/zustand#1667 **Full Changelog**: pmndrs/zustand@v4.3.5...v4.3.6 ### [`v4.3.5`](https://togithub.com/pmndrs/zustand/releases/tag/v4.3.5) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.3.4...v4.3.5) v4.3.4 has a regression in CJS build. Please use this version instead. #### What's Changed - fix(build): re-export createStore from index by [@​hiendv](https://togithub.com/hiendv) in [pmndrs/zustand#1661 #### New Contributors - [@​jmantonellini](https://togithub.com/jmantonellini) made their first contribution in [pmndrs/zustand#1485 - [@​hiendv](https://togithub.com/hiendv) made their first contribution in [pmndrs/zustand#1661 **Full Changelog**: pmndrs/zustand@v4.3.4...v4.3.5 ### [`v4.3.4`](https://togithub.com/pmndrs/zustand/releases/tag/v4.3.4) [Compare Source](https://togithub.com/pmndrs/zustand/compare/v4.3.3...v4.3.4) This version fixes some build configs for some edge cases.⚠️ this version has an issue in CJS build. Please use v4.3.5. #### What's Changed - fix(build): UMD names by [@​dai-shi](https://togithub.com/dai-shi) in [pmndrs/zustand#1632 - fix(build): possibly improve ESM for production build by [@​dai-shi](https://togithub.com/dai-shi) in [pmndrs/zustand#1645 - fix(build): add explicit export paths for cjs by [@​barelyhuman](https://togithub.com/barelyhuman) in [pmndrs/zustand#1659 #### New Contributors - [@​AwesomeDevin](https://togithub.com/AwesomeDevin) made their first contribution in [pmndrs/zustand#1633 - [@​adimit](https://togithub.com/adimit) made their first contribution in [pmndrs/zustand#1641 **Full Changelog**: pmndrs/zustand@v4.3.3...v4.3.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/mheob/ef-calc).
By ading this example we can combine the real Slices pattern implementation (instead of multiple stores) with the resetAll method.
Hope this helps! 😄
Related Issues
Fixes #.
Summary
Check List
yarn run prettier
for formatting code and docs