-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor mutableAtom #1
Conversation
src/mutableAtom/index.ts
Outdated
(_get, { setSelf }) => { | ||
const getValue = () => setSelf({ type: 'getValue' }) as Value | ||
const store: Store<Value> = { | ||
proxyState: createProxyState(getValue(), () => store), |
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.
is setSelf
called synchronous?
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 catch. I overlooked it.
Yeah, that's why I'd only support mutableAtom
. New commit: f6e65fc
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.
This looks great. I'll update the tests once this is merged.
jotaijs#5 (review)