Comment

Comment by geon

A bit of a tangent:

I have been experimenting with replacing REST style backend interaction with websockets an having the state manipulation round-tripping through the server.

Instead of setting values on mutable objects and telling the server about it postfact (having to deal with errors like ba validation and connectivity somehow), I would send a change command to the server, which would decide what to do, and push an updated state back. Once I detect this change of state, I update the UI.

This simplifies error handling a lot, since the user simply can't update state if an error occurs. And I get cuncurrent multi user editing for free.

Unless you want offline editing (which is hard), it's a big win.

parent geon 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton