-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add AsyncContext namespace and Snapshot and Variable #55
Conversation
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 do you think of using a namespace for the 2 classes? Something like: AsyncContext.Snapshot
and AsyncContext.Local
. I like that this
- scopes the APIs to a unified place, making it easier to find the other related class (in docs and when playing around in dev tools)
- Keeps the naming of "context", so that we can refer to all locals as the context and the individual locals as just local.
- Might make loading the code easier for Moddable?
Other than that, some minor naming changes.
I didn't find precedence of constructors nested in a namespace in ecm262 (please correct me if there is one). I think it can be a good idea to do so, like |
We'll have |
Aesthetic thoughts of mine, feel free to ignore:
I haven't reviewed the spec text yet, but don't wait on my review to land it. |
Fixed a few nits and renamed |
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.
Agh, I forgot to hit the comment button on the review.
Co-authored-by: Andreu Botella <[email protected]>
Updated with grouping the classes |
Reverted back to |
This split seems very weird to me. It feels unidiomatic to have a whole separate constructor available for snapshots rather than just a static method that returns a Snapshot type. The snapshot is meant to be a capture of what's in the stores so it seems intrinsically tied to the stores themselves. 🤔 |
To distinguish the abstraction around the global state and local state, replace the built-in class
AsyncContext
withAsyncContext.Snapshot
andAsyncContext.Variable
.Fixes: #44
Fixes: #36
Fixes: #21