Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
Add onConnectionStateChange callback and also change the previous `onDisconnect' callback to receive the current connection state. A subscription can have three different connection states.
connectingin two cases: a) when initially setting up the subscription and waiting for the WebSocket to be established and while waiting for confirmation that the subscription has been set up and b) after what currently triggers onDisconnect and until either getting back to receiving live updates or giving up.
connected while receiving live updates
closed when explicitly closed or when implicitly closed after lost server-side state and automatic resubscribe is not enabled.
Mapping to UI states, connecting corresponds to a loading indicator, connected corresponds to a green light, and closed corresponds to a "retry" button.
Different states should be added as an enum, and the state should be passed as an event object that wraps the state enum value.
Describe your motivation
Add
onConnectionStateChange
callback and also change the previous `onDisconnect' callback to receive the current connection state. A subscription can have three different connection states.connecting
in two cases: a) when initially setting up the subscription and waiting for the WebSocket to be established and while waiting for confirmation that the subscription has been set up and b) after what currently triggers onDisconnect and until either getting back to receiving live updates or giving up.connected
while receiving live updatesclosed
when explicitly closed or when implicitly closed after lost server-side state and automatic resubscribe is not enabled. Mapping to UI states, connecting corresponds to a loading indicator, connected corresponds to a green light, and closed corresponds to a "retry" button.Different states should be added as an enum, and the state should be passed as an event object that wraps the state enum value.
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response