4 ms·
Our company had been looking to move our project away from Knockout.JS and on to Vue/React. I started playing around with native Web Components just because I l
by agquick 6y ago
Our company had been looking to move our project away from Knockout.JS and on to Vue/React. I started playing around with native Web Components just because I like the idea of not being locked into a single framework.
However, I also wanted to keep using observables/computeds so I wrote a quick library that ties MobX with Native Web components, but has a Vue-like binding syntax.
Yes I know it’s yet another library, but it mainly just provides for a simple way to use MobX (an established library) with Web Components (a browser standard), and nothing else. It’s still very new but it works and I’d love feedback.
Example fiddle: https://jsfiddle.net/agquick/d0tsqar6/ https://jsfiddle.net/agquick/d0tsqar6/
Github: https://github.com/agquick/elemx.js https://github.com/agquick/elemx.js
- georges_gomes 6y agoI love this creativity :) We should have you in the next update of the blog post!
- agquick 6y agoThanks, that would be awesome! It really makes state management within custom elements a breeze. I'm hoping others who appreciate observables/mobx will take interest and help me grow/maintain it :)
- alex7o 6y agoYou might not have to replace knockout.js the solid framework author actually has implemented a html rendering lib that has bindings for both knockout.js and mobx. You might find it useful https://github.com/ryansolid/dom-expressions https://github.com/ryansolid/dom-expressions.