misc snapshot

This commit is contained in:
Salakar 2017-03-09 17:18:48 +00:00
parent 199b7ee588
commit da8a2ec645
1 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ export default class Snapshot {
value,
key: childRef.key,
exists: value !== null,
// todo this is wrong - child keys needs to be the ordered keys, from FB
// todo potential solution is build up a tree/map of a snapshot and its children
// todo natively and send that back to JS to be use in this class.
childKeys: isObject(value) ? Object.keys(value) : [],
});
}
@ -50,7 +53,7 @@ export default class Snapshot {
}
forEach(fn: (key: any) => any) {
return this.childKeys.forEach((key, i) => fn(this.child(key), i));
return this.childKeys.forEach(key => fn(this.child(key)));
}
getPriority() {