You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides performing async actions on demand, most applications also need to listen to events passively. An example of this could be a WebSocket connection, where messages can come in at any time.
The idea here is to also follow Elm's footsteps. We can add a method subscriptions(&self) -> Subscription<Message> to Application and keep the subscriptions alive in the runtime.
The challenge here is designing the public API of subscriptions, so users can build their own, and subscription diffing, or basically detecting when a subscription is added/changed/removed. For this, we can take a look at the source code of Elm for inspiration.
The text was updated successfully, but these errors were encountered:
Besides performing async actions on demand, most applications also need to listen to events passively. An example of this could be a WebSocket connection, where messages can come in at any time.
The idea here is to also follow Elm's footsteps. We can add a method
subscriptions(&self) -> Subscription<Message>
toApplication
and keep the subscriptions alive in the runtime.The challenge here is designing the public API of subscriptions, so users can build their own, and subscription diffing, or basically detecting when a subscription is added/changed/removed. For this, we can take a look at the source code of Elm for inspiration.
The text was updated successfully, but these errors were encountered: