bikeshaving / crank

The Just JavaScript Framework

Home Page:https://crank.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restart generator components which return when re-rendered

brainkim opened this issue · comments

The behavior of generator components not rendering or getting stuck after they return is confusing, and not useful, especially when you’re quickly refactoring from function components to generator components. The problem is that the getting stuck behavior doesn’t provide any hints to the developer about where the component is stuck, which makes finding returned generator components extremely difficult. I’m also pretty sure there are no valid use-cases for the current behavior.

We should consider making it so that generator components which return are restarted when re-rendered. This would allow developers to at least see that the generator component is executing.

Additionally, it might make sense to emit a console warning when generator components return early, though I’m not as sure about this last part. A console warning would only make sense if there are no conceivable use-cases for returning from a generator component.

Changed in 0.5.0