Skip to content

Commit 8ba5abd

Browse files
committed
Updated snapshot to be returned on once
1 parent 7209837 commit 8ba5abd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/firestack.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export class Firestack {
173173

174174
off(name) {
175175
if (this.eventHandlers[name]) {
176-
this.eventHandlers[name].forEach(subscription => subscription.remove());
176+
this.eventHandlers[name]
177+
.forEach(subscription => subscription.remove());
177178
}
178179
}
179180
}

lib/modules/database.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class DatabaseRef {
117117
const {path} = this.dbPath();
118118
const modifiers = this.dbModifiers();
119119
return promisify('onOnce', FirestackDatabase)(path, modifiers, evt)
120+
.then(({snapshot}) => new DataSnapshot(snapshot))
120121
}
121122

122123
off(evt) {

0 commit comments

Comments
 (0)