2
0
mirror of synced 2025-02-20 18:18:10 +00:00

misc snapshot

This commit is contained in:
Salakar 2017-03-09 17:18:48 +00:00
parent 199b7ee588
commit da8a2ec645

View File

@ -41,6 +41,9 @@ export default class Snapshot {
value, value,
key: childRef.key, key: childRef.key,
exists: value !== null, 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) : [], childKeys: isObject(value) ? Object.keys(value) : [],
}); });
} }
@ -50,7 +53,7 @@ export default class Snapshot {
} }
forEach(fn: (key: any) => any) { 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() { getPriority() {