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
You can define and aggregate multiple subscriptions with a call to `cmd.batch(...)`.
434
+
Because the return type is an array, you can define and return multiple subscription functions.
435
435
436
436
### Cleanup subscriptions
437
437
438
-
In the solution above `setInterval` will trigger events even if the component is removed from the DOM. To cleanup subscriptions, we can return a `destructor` function from the subscription the same as in the `useEffect` hook.
438
+
In the solution above `setInterval` will trigger events even if the component is removed from the DOM. To cleanup subscriptions, we can return a `destructor` function the same way as in the `useEffect` hook.
439
439
440
440
Let's rewrite our `subscription` function:
441
441
442
442
```ts
443
443
function subscription (model:Model):SubscriptionResult<Message> {
0 commit comments