diff --git a/lib/modules/database/snapshot.js b/lib/modules/database/snapshot.js index 832fa5cf..9a3ffbc8 100644 --- a/lib/modules/database/snapshot.js +++ b/lib/modules/database/snapshot.js @@ -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() {