-
Notifications
You must be signed in to change notification settings - Fork 8
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
immer example for createSliceWithImmer #26
Conversation
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. |
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.
Thanks for working on it.
Can you add entries in package.json and README.md too?
Find how 03_actions
is configured there.
"version": "0.0.0", | ||
"private": true, | ||
"type": "module", | ||
"dependencies": { |
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.
We need "immer"
too.
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.
I added immer as a dependency in the examples folder, I need to also add
"examples:01_counter": "DIR=01_counter vite",
"examples:02_async": "DIR=02_async vite",
"examples:03_actions": "DIR=03_actions vite",
"examples:04_immer": "DIR=04_immer vite"
to the root package.json but it seems something desynced my local branch to this pull request and I'm hesitant to make any force pushes (fixed)
I ran the example locally and it worked fine. Noteworthy that to run it in windows the script is
"examples:04_immer": "set DIR=04_immer&& vite"
edit: I also see stackblitz URLs in the README, but the new createSliceWithImmer
method right now isn't included in the latest published version on NPM so it isn't yet accessible without a local clone using npm link
so the method is not accessible on stackblitz right now
It will run when we release a new version. But, I can update README later.
I'm wondering if this works for windows users: https://pnpm.io/cli/run#shell-emulator |
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.
LGTM!
Example case for
createSlicesWithImmer
Also primitives values for slices can be used with explicit returns that do not modify the draft state as shown in
textSlice
so that's nice