-
Notifications
You must be signed in to change notification settings - Fork 3
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
Built-in State Management Proposal #18
Labels
enhancement
New feature or request
Comments
@JAForbes this seems like a tremendously great approach; almost too good to be true! I'd love to have it in an alpha branch sooner than later. I'm curious what the accompanying persistence idioms would/should look like. |
Yeah seems like there's a bit of support (even @barneycarroll has come around to it 😂). I'll try and find the time to implement a prototype if there's no objections. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumptions
Solutions
Examples
If
state
wasn't already provided as an attribute, every component will receivestate
as an attr. The default reference will be the state the parent component received.state
instances will have a few methods for relational queries.map
for mapping over listsfind
for selecting an item in a listdelete
for removing an item from a listThese methods are different from attain queries, where operations focus on the query not the underlying value. But vella doesn't need to be so puritanical because it has a specific use case in mind - so it can optimize the api to feel more like working with native JS structures.
An example of
.find
And
.delete()
A simple counter example (excuse any typos):
The text was updated successfully, but these errors were encountered: