←back to thread

11 points asika32764 | 1 comments | | HN request time: 0.201s | source

A library to implement directive pattern for native HTML without any framework, which is inspired by Vue.js.
1. jauntywundrkind ◴[] No.45636408[source]
Similar but different, I really dig the nice spatial/3d webcomponent https://Lume.io 's ECS / behavior system. Standalone library, works for anything. https://github.com/lume/element-behaviors

Here, the presence of an attribute signals behavior. With element-behaviors, has= attribute is used to say what behavior classes to apply. Different paths but doesn't seem super dissimilar end result. I feel like web-directive giving a simple callback leaves a lot to the developer, where-as element-behaviors API surface tries to parallel WebComponents, which is familiar & has lots of nice understandable lifecycle builtin.