Skip to content

Commit

Permalink
feat: add missing Subscription API descriptions (#4044)
Browse files Browse the repository at this point in the history
Fixes #4008

Co-authored-by: Anton Platonov <[email protected]>
  • Loading branch information
taefi and platosha authored Dec 20, 2024
1 parent c84a798 commit 11e1044
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions articles/hilla/lit/guides/reactive-endpoints.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,10 @@ Be informed when the Flux has no more messages to send.
[methodname]`context()`::
Bind to the context, which allows the application automatically to close it when the view is detached.

[methodname]`onSubscriptionLost()`::
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`.

[methodname]`onConnectionStateChange()`::
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`.

// end::content[]

0 comments on commit 11e1044

Please sign in to comment.