Calling external APIs from Hologram

Hmmm… you’re thinking about server-side state for components, which is a natural question coming from LiveView! Hologram is designed to keep component state on the client side - right where the user interactions happen. This approach actually makes a lot of sense for most use cases.

For your form example, I think storing the form data on the client would actually be better than server-side state. Here’s why: the user is filling out the form on the client, and all the form processing code gets transpiled to JavaScript and runs right there in the browser too. This keeps everything close together and responsive.

Could you share a specific use case where you think server-side component state would be beneficial? I’m curious to understand the scenario you have in mind, as the current client-side approach works really well for most interactive patterns.

Interesting! Could you give some link to see it in action? I couldn’t find it anywhere.

This just made my day :smiling_face_with_tear: Thank you so much!

I would say that naming of pushing something should not change only if source is same as target, so changing something server-side on server or changing something client-side on client.

Alternatively we could use separate naming patterns like set and push, so we say that we are setting things when source is as same as target and pushing things to a different target i.e. client -> server or server -> client. This way we would have set_session and push_state.

3 Likes