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
function*Component(){constinterval=setInterval(()=>{// Do something},1000);try{while(true){yieldhtml`Hi`;}}finally{// Runs when unmountingclearTimeout(interval);}}
Can it be supported? Or is there already some way to do it?
EDIT: @aidenybai From what I understand, Crank.js does that by calling return() on the generator when unmounting, so JS will automatically run the finally blocks. Seems relatively simple. 🤔
The text was updated successfully, but these errors were encountered:
I'd like to do something like this:
Can it be supported? Or is there already some way to do it?
EDIT: @aidenybai From what I understand, Crank.js does that by calling
return()
on the generator when unmounting, so JS will automatically run the finally blocks. Seems relatively simple. 🤔The text was updated successfully, but these errors were encountered: