Yep. It's because the first thing each computation execution does is remove itself from the subscription list and then during the process of execution if it reads the same signal it adds itself back on. What this means is if we don't clone the original list, while iterating over it the process of executing the computation will cause it to end up at the end of the list. And it will then execute it again within the same loop, and add itself to the end of the list and so on.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Ryan, If I change
[...subscriptions]
tosubscriptions
. it will causes infinite loop.to
Error:
What is the cause? Thank you so much. Full Code
Yep. It's because the first thing each computation execution does is remove itself from the subscription list and then during the process of execution if it reads the same signal it adds itself back on. What this means is if we don't clone the original list, while iterating over it the process of executing the computation will cause it to end up at the end of the list. And it will then execute it again within the same loop, and add itself to the end of the list and so on.