Skip to content

Commit 11e1044

Browse files
taefiplatosha
andauthored
feat: add missing Subscription API descriptions (#4044)
Fixes #4008 Co-authored-by: Anton Platonov <anton@vaadin.com>
1 parent c84a798 commit 11e1044

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

articles/hilla/lit/guides/reactive-endpoints.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,10 @@ Be informed when the Flux has no more messages to send.
176176
[methodname]`context()`::
177177
Bind to the context, which allows the application automatically to close it when the view is detached.
178178

179+
[methodname]`onSubscriptionLost()`::
180+
Called when the connection is restored, but there's no longer a valid subscription. If the callback returns `ActionOnLostSubscription.RESUBSCRIBE`, the subscription will be re-established by connecting to the same server method again. If the callback returns `ActionOnLostSubscription.REMOVE`, the subscription will be forgotten. This is also the default behavior if the callback is not set or if it returns `undefined`.
181+
182+
[methodname]`onConnectionStateChange()`::
183+
Called when the subscription state changes. The callback receives an event of type `FluxSubscriptionStateChangeEvent` that contains the new state. The possible states are defined as enumerated values of `CONNECTING`, `CONNECTED`, and `CLOSED`.
184+
179185
// end::content[]

0 commit comments

Comments
 (0)