viewFactory + tree shaking
- Tree shaking finally enabled! (as npm module)
- viewFactory added:
import { list, viewFactory } from 'redom';
class A {
constructor () {
this.el = el('a');
}
update () {
...
}
}
class B {
constructor () {
this.el = el('b');
}
update () {
...
}
}
const items = list('items', viewFactory({ a: A, b: B }, 'type'), 'id');
items.update([{ id: 1, type: 'a' }, { id: 2, type: 'b' }]);
––>
<items>
<a></a>
<b></b>
</items>