abstracted-firebase
Advanced tools
Comparing version 0.11.4 to 0.11.5
@@ -40,3 +40,3 @@ 'use strict'; | ||
class RealTimeDB { | ||
constructor(config = {}) { | ||
constructor() { | ||
this._isConnected = false; | ||
@@ -49,8 +49,2 @@ this._waitingForConnection = []; | ||
this._allowMocking = false; | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
@@ -285,2 +279,17 @@ query(path) { | ||
} | ||
/** | ||
* initialize | ||
* | ||
* Allows the core module to initialize the object after the | ||
* client or admin modules constructors are called | ||
* | ||
*/ | ||
initialize(config = {}) { | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
handleError(e, name, message = "") { | ||
@@ -287,0 +296,0 @@ console.error(`Error ${message}:`, e); |
@@ -38,3 +38,3 @@ (function (global, factory) { | ||
class RealTimeDB { | ||
constructor(config = {}) { | ||
constructor() { | ||
this._isConnected = false; | ||
@@ -47,8 +47,2 @@ this._waitingForConnection = []; | ||
this._allowMocking = false; | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
@@ -283,2 +277,17 @@ query(path) { | ||
} | ||
/** | ||
* initialize | ||
* | ||
* Allows the core module to initialize the object after the | ||
* client or admin modules constructors are called | ||
* | ||
*/ | ||
initialize(config = {}) { | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
handleError(e, name, message = "") { | ||
@@ -285,0 +294,0 @@ console.error(`Error ${message}:`, e); |
@@ -32,3 +32,2 @@ import { SerializedQuery } from "serialized-query"; | ||
protected _allowMocking: boolean; | ||
constructor(config?: IFirebaseConfig); | ||
query<T = any>(path: string): SerializedQuery<T>; | ||
@@ -109,4 +108,12 @@ /** Get a DB reference for a given path in Firebase */ | ||
exists(path: string): Promise<boolean>; | ||
/** | ||
* initialize | ||
* | ||
* Allows the core module to initialize the object after the | ||
* client or admin modules constructors are called | ||
* | ||
*/ | ||
protected initialize(config?: IFirebaseConfig): void; | ||
protected handleError(e: any, name: string, message?: string): Promise<never>; | ||
protected getFireMock(): Promise<typeof import("firemock")>; | ||
} |
@@ -12,3 +12,3 @@ import * as convert from "typed-conversions"; | ||
export class RealTimeDB { | ||
constructor(config = {}) { | ||
constructor() { | ||
this._isConnected = false; | ||
@@ -21,8 +21,2 @@ this._waitingForConnection = []; | ||
this._allowMocking = false; | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
@@ -257,2 +251,17 @@ query(path) { | ||
} | ||
/** | ||
* initialize | ||
* | ||
* Allows the core module to initialize the object after the | ||
* client or admin modules constructors are called | ||
* | ||
*/ | ||
initialize(config = {}) { | ||
if (config.mocking) { | ||
this._mocking = true; | ||
this.getFireMock().then(() => { | ||
console.log("mocking db established"); | ||
}); | ||
} | ||
} | ||
handleError(e, name, message = "") { | ||
@@ -259,0 +268,0 @@ console.error(`Error ${message}:`, e); |
{ | ||
"name": "abstracted-firebase", | ||
"version": "0.11.4", | ||
"version": "0.11.5", | ||
"description": "Core library supporting 'abstracted-admin' and 'abstracted-client' libraries", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87006
191
1074