Investigate how (one?) way binding could be provided. This is not about implementing a new binding mechanism but allowing existing ones to be used.
The main goal is to unify the syntax to define the default document with the incorporation of changes triggered over time by external events.
dynamic function indicates a value that will change over time. It can be used for document definition. It accepts a key part (type/value) and a function that extracts some value from what is provided by the change observer.
Each time dynamic changes a propagation is triggered. How the propagation is incorporated in the existing document is user definable (react integration).
A change observer has a simple lifecycle hooking on element lifecyle. e.g. this allows events observers to register/unregister when an element instance is attached/detached.
on allows to register to events and call functions accordingly. It supersedes on-* style callbacks.
For simplicity all events could use a per instance core.async chan. It could also allow for easy filtering/debouncing. See this.
Investigate how (one?) way binding could be provided. This is not about implementing a new binding mechanism but allowing existing ones to be used. The main goal is to unify the syntax to define the default
document
with the incorporation of changes triggered over time by external events.An idea would be to rely on separated phases:
Change sources include:
Some sources of inspiration include:
Potential syntax:
dynamic
function indicates a value that will change over time. It can be used fordocument
definition. It accepts a key part (type/value) and a function that extracts some value from what is provided by the change observer. Each timedynamic
changes a propagation is triggered. How the propagation is incorporated in the existing document is user definable (react integration). A change observer has a simple lifecycle hooking on element lifecyle. e.g. this allows events observers to register/unregister when an element instance is attached/detached.on
allows to register to events and call functions accordingly. It supersedeson-*
style callbacks.For simplicity all events could use a per instance core.async chan. It could also allow for easy filtering/debouncing. See this.
It should play nicely with nested components.
Style
It might be interesting to animate css values too. In this case will-change could be injected automatically.