Skip to content
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

refactor mutableAtom #1

Merged

Conversation

dai-shi
Copy link

@dai-shi dai-shi commented Oct 6, 2023

(_get, { setSelf }) => {
const getValue = () => setSelf({ type: 'getValue' }) as Value
const store: Store<Value> = {
proxyState: createProxyState(getValue(), () => store),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is setSelf called synchronous?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I overlooked it.
Yeah, that's why I'd only support mutableAtom. New commit: f6e65fc

@dmaskasky dmaskasky self-requested a review October 6, 2023 04:57
Copy link
Owner

@dmaskasky dmaskasky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I'll update the tests once this is merged.

@dmaskasky dmaskasky merged commit 59ca83d into dmaskasky:jotai-to-valtio-proxy-state Oct 6, 2023
@dai-shi dai-shi deleted the mutableAtom branch October 6, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants