Hacker News new | ask | show | jobs
by christophilus 1212 days ago
I do this in Preact and it is a breeze.

But I also did it in an old Rails app with a bit of jQuery and partials. The modal loaded its markup from an endpoint. Saving was an http post that returned html which I injected into the DOM using some basic sorting / filtering logic. It was… ok, but there was duplicated logic on the front and back ends. I think if I had to abandon SPAs again, I’d probably have the “save” endpoint return the full page and just replace the html each time so that all logic lived in one place. To hell with efficiency— it’d probably be just fine and quite simple.

1 comments

With Angular it is not even a breeze it is something you have out of the box no questions asked. Save endpoint returns data only for single item on the list and it is updated in place in the list with two-way-binding on return of request.