Open JAForbes opened 4 years ago
@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.
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):