From e3a1dc90d7e860d460801962556010491ea44d90 Mon Sep 17 00:00:00 2001 From: Victor Kotseruba Date: Tue, 29 Mar 2016 19:15:25 +0800 Subject: [PATCH] optional idField --- package.json | 2 +- src/FirebaseList.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e0e1c49..423bdc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kebakaran", - "version": "0.4.0", + "version": "0.4.1", "description": "high level utilities for firebase interaction", "main": "index.js", "scripts": { diff --git a/src/FirebaseList.js b/src/FirebaseList.js index 4834acc..759e2ef 100644 --- a/src/FirebaseList.js +++ b/src/FirebaseList.js @@ -120,7 +120,10 @@ export class FirebaseList extends Emitter { } get data() { - return this.keys.map(key => ({ ...this.values[key], [this.idField]: key })); + if (this.idField) { + return this.keys.map(key => ({ ...this.values[key], [this.idField]: key })); + } + return this.keys.map(key => ({ ...this.values[key] })); } flush() {