A Generator is push based.
That means by subscribing to the value attribute each time there is a change the result is recompiled.
This is achieved using rxjs which might be worth looking into if you want to use the generators.
Check out Sample 4 which uses a Generator in code.