react-native-firebase-compiled
Version:
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
78 lines (60 loc) • 1.88 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("../../utils");
var _native = require("../../utils/native");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect
* @class OmDisconnect
*/
class OnDisconnect {
/**
*
* @param ref
*/
constructor(ref) {
_defineProperty(this, "_database", void 0);
_defineProperty(this, "ref", void 0);
_defineProperty(this, "path", void 0);
this.ref = ref;
this.path = ref.path;
this._database = ref._database;
}
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect#set
* @param value
* @returns {*}
*/
set(value) {
return (0, _native.getNativeModule)(this._database).onDisconnectSet(this.path, {
type: (0, _utils.typeOf)(value),
value
});
}
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect#update
* @param values
* @returns {*}
*/
update(values) {
return (0, _native.getNativeModule)(this._database).onDisconnectUpdate(this.path, values);
}
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect#remove
* @returns {*}
*/
remove() {
return (0, _native.getNativeModule)(this._database).onDisconnectRemove(this.path);
}
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect#cancel
* @returns {*}
*/
cancel() {
return (0, _native.getNativeModule)(this._database).onDisconnectCancel(this.path);
}
}
exports.default = OnDisconnect;
;