list-patch
Patch a list of DOM elements.
Why
You want to apply changes to a list of dom elements as lazily as possible.
How
Remove old, add new, sort.
Example
Add some elements:
var states =id: 'a'id: 'c'id: 'b'document{return document}console// <x-row>a</x-row>// <x-row>c</x-row>// <x-row>b</x-row>
Reorder:
statesconsole// <x-row>a</x-row>// <x-row>b</x-row>// <x-row>c</x-row>
Remove:
statesconsole// <x-row>b</x-row>// <x-row>c</x-row>
Custom key name, each callback:
var states =name: 'a'name: 'b'name: 'c'console// <x-row>b</x-row>// <x-row>c</x-row>
License
MIT