| with affinity you can make multiple apps (components eventually) and store (ala redux) - while a store can be shared through apps. This started as a case study and as a small reusable code for creating self contained dom elements with functionality - during the time of development, ideas and inspiration came from angular, react and vuejs. suggestions and feedback is mostly welcomed. The interesting challenges were finding ways for these topics: 1. create a component lib using dom and js only, without any 3rd party . 2. producing semantic html in dom . 3. allow template micro syntax (using @click to bind an event listener) . 4. allow reusing custom elements within a component's template . 5. creating a simple store interface and auto connect it with
a component to allow re render whenever the store changes . any feedback and suggestions are welcomed https://github.com/orizens/affinity |
1. Parser prohibits literal "@click", there is no escape mechanism.
2. Only click, what about other DOM events?
3. Leaking: Event listeners not removed in destructor (your clean() function?)
4. No XSS protection, ow.
5. No tests, might want some.
6. Based on innerHTML assignment with nothing to guarantee valid HTML.
7. No error handling.