Replies: 4 comments
|
Where would the right place to specify this behavior be? In the view or the handler? |
|
If I've understood your question correctly, then the right place would be in the The swap mode can be associated with the I've not thought about the implementation-specific details. I can share a brief So the usage would look like so: |
|
I don't hate it, but this complicates the idea of what a
The only reason you would want to append is for performance, right? Imagine for a minute that there were no performance cost to re-rendering the whole view. There is great value in avoiding the need to track DOM state: if the view is always a function of the input, it's impossible for the data and the view to get out of sync. Performance can be a real consideration, but preserving our sanity as developers is much more important. I don't think we can ignore the desire to append data forever, but we need a really clean way to do this that doesn't break what makes Hyperbole happy for developers. Let's wait until after our next release. |
|
Perhaps for this use case, we can use a different abstraction (maybe HyperStreams) akin to Turbo Streams. PS: I think GitHub discussions have very low visibility. The only reason I know this issue was converted to a discussion is because there is tiny text at the end of the closed issue. The backlinks to the issue aren't preserved either, so referrers will have a hard time finding this. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hx-swaplike feature may actually be very useful. Primarily to append a newelement to the list of elements.
Right now, since the entire hyperview is replaced, I have to think about the
entire view rather than just adding a new element at the end of a hyper view. I
also have to fetch the entire list again from my store on every addition.
In the
Todoexample, we doTodos.loadAllevery time there is aSubmitTodo.All reactions