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
The yield* each(items) will create a subscription that needs to be disposed of when the loop exits.
When leaving the loop, JavaScript will invoke the return() method of the iterator returned by yield* each(), so there is an opportunity to insert the teardown of the subscription there. It is not enough to use ensure() because that will execute at the very end of the frame, but we don't know how long that could take. Instead, we need the teardown of the subscription to be the next thing that happens in the frame, including before it returns. In this case, it would start evaluating thing(x), but before it did, it would run the subscription teardown.
The text was updated successfully, but these errors were encountered:
There are certain cases when you want to add operations to the front of a frame to execute teardown.
each()
The
yield* each(items)
will create a subscription that needs to be disposed of when the loop exits.When leaving the loop, JavaScript will invoke the return() method of the iterator returned by
yield* each()
, so there is an opportunity to insert the teardown of the subscription there. It is not enough to useensure()
because that will execute at the very end of the frame, but we don't know how long that could take. Instead, we need the teardown of the subscription to be the next thing that happens in the frame, including before it returns. In this case, it would start evaluatingthing(x)
, but before it did, it would run the subscription teardown.The text was updated successfully, but these errors were encountered: