Comparing version 0.11.0 to 0.11.1
@@ -15,3 +15,3 @@ /** | ||
key: (options && options.key) || getKey, | ||
children: Object.create(null), | ||
map: Object.create(null), | ||
} | ||
@@ -41,3 +41,3 @@ } | ||
var key = getK.constructor === Function ? getK(arr[i], i, arr) : arr[i][getK], | ||
kid = this.children[key] | ||
kid = this.map[key] | ||
//create or update kid | ||
@@ -61,4 +61,4 @@ if (kid) kid.update && kid.update(arr[i], key, arr) //eslint-disable-line | ||
this.children = kids | ||
this.map = kids | ||
return this | ||
} |
{ | ||
"name": "attodom", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"main": "./index.js", | ||
@@ -5,0 +5,0 @@ "description": "yet another small DOM component library", |
@@ -53,3 +53,3 @@ # attodom | ||
### Lists | ||
* `list(parent, factory, options): List` | ||
* `list(parent:Node, factory, options): List` | ||
@@ -61,3 +61,3 @@ where | ||
* `options.key: string | function([*], [number], [Array]): string` | ||
* `List: {parent, before, after, factory, key, children, update}` | ||
* `List: {parent, before, after, factory, key, map:{key:Node}, update}` | ||
* `list.update: function([*], [number], [Array]): List` | ||
@@ -64,0 +64,0 @@ |
@@ -29,2 +29,5 @@ /* global document */ | ||
ct('===', toString(kin.childNodes), 'a') | ||
list.update([]) | ||
ct('===', kin.childNodes.length, 0) | ||
ct('===', Object.keys(list.map).length, 0) | ||
}) | ||
@@ -31,0 +34,0 @@ |
17679
393