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.