samedi 5 septembre 2020

What does the "pull-based functional reactive program" mean in Glimmer VM?

As I saw the notion "pull-based functional reactive program"" in this article: https://engineering.linkedin.com/blog/2017/06/glimmer--blazing-fast-rendering-for-ember-js--part-2

As I know, the "pull-based" means we have to use a regular polling way to check and update the UI according to the latest value of the states. But I think there would be a lot of wasteful "polling" and may even cause the inefficiency of the app running if the app has a lot of states and they are actually not frequently changed most of the time.

So, I think there should be something I missed here, how can I understand that?

While a VM architecture is a novel way of modeling rendering, the initial execution of the VM sets up Reference and Revision Tag subsystems, which allow us to model a pull-based functional reactive program (FRP) used for updating the UI. What this means in practice is that there is no notion of observers or subscriptions to keep values updated in the UI, but rather that we allow the backing values in a template to freely mutate. For now, the simplest way to conceptualize this system is something like the following:




Aucun commentaire:

Enregistrer un commentaire