-
-
Notifications
You must be signed in to change notification settings - Fork 663
fix: expose an internal function for devtools #3045
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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. |
commit: |
|
Playground | Link |
---|---|
React demo | https://livecodes.io?x=id/8W3TMTSAJ |
See documentations for usage instructions.
Size Change: +249 B (+0.26%) Total Size: 97.6 kB
ℹ️ View Unchanged
|
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! I'll test this build tomorrow too
export function INTERNAL_overrideCreateStore( | ||
fn: (prev: typeof createStore | undefined) => typeof createStore, | ||
): void { | ||
overiddenCreateStore = fn(overiddenCreateStore) | ||
} | ||
|
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 export it out of jotai/vanilla
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.
Yeah, I forgot there was a follow-up commit. Thanks.
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.
Nice! Works as expected! 🎉
Related Bug Reports or Discussions
#3023
Summary
This allows overriding createStore. It's not very recommended, but can't be helped to avoid breaking changes. We may revisit this in the next major version. cc @arjunvegda
Check List
pnpm run fix
for formatting and linting code and docs