#lustre_omnistate -- share local state with remote

1 messages · Page 1 of 1 (latest)

nocturne yacht
#

This library lets you dispatch Lustre messages for a server to handle.

It is built for when a server is the source of truth, but the client needs control of the render.

For example, a chat app needs to render messages even before they were received by the server, but the state of all other messages strictly depends on the server state. Instead of manually syncing, lustre_omnistate allows you to just dispatch and handle messages, making the process a breeze.

Well, almost a breeze, the current boilerplate challenge is the need for encoders/decoders, and having to wrap the different messages, which I wish I could do automatically in the library.

Here's a minimal demo of the chat app use case:
https://github.com/weedonandscott/lustre_omnistate/blob/master/example/client/src/client/chat.gleam
https://github.com/weedonandscott/lustre_omnistate/blob/master/example/server/src/server/router.gleam

And the repo itself:

https://github.com/weedonandscott/lustre_omnistate

No docs yet, and not quite happy with the API yet (especially error handling) :X

untold mortar
#

do all the messages go to the server or do you have some control over which ones go?

#

ah yeah i see you slice your messages and omnistate handles the shared ones

#

interesting idea, excited to see it polished up!

nocturne yacht
keen gale