Firebase Stub: simple implementation of data changes listener

This commit is contained in:
gianantoniopini
2021-01-14 14:00:07 +01:00
parent 36036cc411
commit 6d36c27889
5 changed files with 193 additions and 60 deletions
@@ -1,4 +1,6 @@
/* eslint-disable no-underscore-dangle */
import DatabaseConstants from '../constants/database';
class DataSnapshot {
constructor(eventType, getData, value = undefined) {
if (!eventType) {
@@ -29,7 +31,7 @@ class DataSnapshot {
}
val() {
if (this.eventType === 'value') {
if (this.eventType === DatabaseConstants.valueEventType) {
return typeof this.value !== 'undefined' ? this.value : this._getData();
}