Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Migrating Async/Await to Promise #403
Migrating Async/Await to Promise #403
Changes from all commits
0dc8df0
e1d6539
64ec1a5
7bfb38e
658e9c9
d80f3f0
b6c7953
055dd02
544b96d
3935b50
a6f4f1f
d213ae8
fc4a4ab
bc9ff93
cb704bc
fc9fdd1
8e91e5b
76e1dd0
bc17cd7
4388753
6de92a2
8dda53e
fde0b7a
5e06a34
0f7dca9
a880363
372a192
58430ef
998f038
9cea260
f39f077
cd36c95
2e75b6e
f8f586d
473c16a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
see #409
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.
removing
?? false
just works?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 if the version is
0
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.
No, my bad. This doesn't even work if the version is
0
. So maybe something like:typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== version
?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.
StorageValue<S>
requires version to benumber
so we can even throw an error if typeof ... !== "number".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.
Well, that wouldn't permit to store a primitive value as in #409
But maybe there is a reason not to allow that?
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.
well, if we want to allow non-version store, we should also change the
StorageValue<S>
type. I'm fine with either way.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.
Should we tackle it as a separate PR?
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.
Yes, let's merge this first
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.
What is this for? I'm not sure to understand since we're not reassigning console.error, and you're neither mocking it.
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 did copy that from
persistent.test.tsx
and not verify that it's needed, good catch. I can be removed, right? Might make sense to remove it frompersistent.test.tsx
as well, I guess.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.
Actually this concerns all test files. It's not apparent to me why
console.error
gets mocked. Does zustand write toconsole.error
, and the mocks where once verifying that? Address in a separate PR?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.
cc @dai-shi
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.
@barbogast
Totally. They are not well maintained, I'd say... 😅 Happy to take PRs for improvements. Please address in a separate PR.