[android,js][database] transactions support implemented

This commit is contained in:
Salakar
2017-03-24 22:53:56 +00:00
parent 61d6358ce0
commit bb6b1aa7f2
6 changed files with 487 additions and 50 deletions

View File

@@ -5,8 +5,9 @@
import { NativeModules, NativeEventEmitter } from 'react-native';
import { Base } from './../base';
import Snapshot from './snapshot.js';
import Reference from './reference.js';
import Snapshot from './snapshot';
import Reference from './reference';
import TransactionHandler from './transaction';
import { promisify } from './../../utils';
const FirebaseDatabase = NativeModules.RNFirebaseDatabase;
@@ -19,10 +20,11 @@ export default class Database extends Base {
constructor(firebase: Object, options: Object = {}) {
super(firebase, options);
this.subscriptions = {};
this.errorSubscriptions = {};
this.serverTimeOffset = 0;
this.errorSubscriptions = {};
this.persistenceEnabled = false;
this.namespace = 'firebase:database';
this.transaction = new TransactionHandler(firebase, this, FirebaseDatabaseEvt);
if (firebase.options.persistence === true) {
this._setPersistence(true);