You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched for an existing RRFC which might be relevant to my RRFC
Motivation
Given the prevalence of subscribable reactive primitives in front-end development (such as RxJS Observables and Preact Signals), it would be win for developer experience and interop if lit-html supported binding to them directly without needing to use a custom Async Directive.
Motivation
Given the prevalence of subscribable reactive primitives in front-end development (such as RxJS Observables and Preact Signals), it would be win for developer experience and interop if
lit-html
supported binding to them directly without needing to use a custom Async Directive.Example
These examples are live here.
RxJS
Preact Signals
How
The above examples use a naive implementation found here: https://github.com/willmartian/lit-signals
It works by utilizing an
ObserveDirective
, identical to the example in the Async Directive docs.Any subscribable objects are automatically wrapped in the directive:
I am sure there is a more nuanced way to actually implement this, but my assumption is that this is a fairly light weight addition.
Current Behavior
The current behavior requires the developer to wrap wrap any subscribable values in a custom Async Directive.
Desired Behavior
References
The text was updated successfully, but these errors were encountered: