Reactivity of Omega
How Omega Handles reactivity
Introduction
Reactivity is the core of any UI library or framework, and Omega leverages reactivity, by first detaching reactive primitives like State
and Store
from the UI itself.
The reactive primitives of omega works independent of the UI, which is to set or update the state value, or to give the latest value to the caller, or to listen to changes to the state and notify the subscribers.
The dynamic directives, on the other hand are Components that depends on those state, and do some work on the UI.
Ultimately, all comes down to the driver and the platform being used. The dynamic directives can be thought of the outline of a dynamic definition, like $property
or $node
and so on. The driver, understands it and processes them respectively.
Implications
By detaching the state from the UI in a sense that the "reactive primitives" are reactive, regardless of weather they are being used in the UI or not, helps us not only reduce single-component states, but infact share states among several components, without any additional state management library.
This makes the code consistent, and ultimately, debugging very easy. The final build is also small, and is very efficient, due to the use of "out-of-the-box" state solutions.
Last updated