[context] element-based API
It would be great to have an element-based API, because it would make the context pattern not only usable with any Custom Element authoring patterns whether as `function` or `class` (Lit, solid-element, Enhance, Lume, etc), but also usable in any non-custom-element frameworks (React/Vue/Svelte/Solid/Angular/etc).
I wrote all the details and examples here initially:
- https://github.com/open-wc/context-protocol/issues/25
But maybe it would be more useful as an update to the context protocol here?
The context protocol here documents only the event-based pattern. Would it be useful to also standardize both a mixin pattern and an element-based pattern? (Or at least the element pattern, because that's as stadards aligned as we can get, offering flexibility across all custom- and non-custom-element frameworks)
14 条评论