-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
feat(core): experimental unstable versioned write for limited use case #854
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/jotai/2pabms4dr23ebJ8oQbiBJfRNZez8 |
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 685ae4e:
|
Size Change: +1.59 kB (+4%) Total Size: 43.4 kB
ℹ️ View Unchanged
|
src/core/store.ts
Outdated
@@ -77,6 +81,7 @@ export const WRITE_ATOM = 'w' | |||
export const COMMIT_ATOM = 'c' | |||
export const SUBSCRIBE_ATOM = 's' | |||
export const RESTORE_ATOMS = 'h' | |||
export const VERSION_OBJECT = 'v' |
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'd call this "SNAPSHOT"
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, it's just new Object()
.
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.
Alright 👍
Experimenting with https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-rendering
Works as hoped. |
https://github.com/krausest/js-framework-benchmark results DefaultDuration in milliseconds ± 95% confidence interval (Slowdown = Duration / Fastest) unstable_enableVersionedWriteDuration in milliseconds ± 95% confidence interval (Slowdown = Duration / Fastest) |
I've been working on this for a few months now. It's since #687. Let's see how it goes. I will do some experiments and some patch releases towards this.