Fork me on GitHub

Has anyone implemented re-frame event routing to the server via websocket, and having re-frame-like api on server side to register handlers for these events? I would like to be able processing some events both on client and server while server side handler implementation would dispatch new events to the one or many clients. Is something like this already available?


@drapanjanas: why websocket? I’m waiting for, which will likely replace my current combo re-frame+reagent. Maybe look into how they do state transition, on client side (optimistically) and server side


Well, I am quite happy how re-frame model works on client, so thought of extending same event model to the server side. Nothing fancy just seamless event routing and a possibility of dispatching re-frame compatible events asynchronously from server


websocket just as a transport layer for events


@darwin I will definitely have a closer look to, can not reason about it now. Does it implements some kind of server push too?


hi - i have a beginner question. looking at the todomvc example, each subscription function takes the global app state in the db argument - but where is it defined that the global app state it receives is the one defined in db.cljs ? Does that question even make sense?


i read that actually simple_smile i see the initialize-db handler that’s called on init, which returns the merged value of default value and what comes from local storage…. is that a blessed handler or something? i know i’m missing something obvious here, sorry


oh dang - is the return value from the handlers the new state of the app db?


and then i was looking at wondering if that meant a smaller db per panel, but that just handles data operations, and re-frame gives you the top-level global app-db


yeah the return value of the handler is the new app-state


so make sure you return an app-state even if you're doing side effects


got it, that’s fantastic. and now :initialize-db actually makes sense now too. thanks to all!