revert #869 to fix #1292 temporarily

This commit is contained in:
Salakar 2018-07-11 08:21:02 +01:00
parent 5be43f10a6
commit 2e2913114a
1 changed files with 10 additions and 10 deletions

View File

@ -299,15 +299,15 @@ export default class Reference extends ReferenceBase {
* @param onComplete
* @returns {*}
*/
push(value: any, onComplete?: Function): ThenableReference<void> {
push(value: any, onComplete?: Function): Reference | Promise<void> {
if (value === null || value === undefined) {
return new ThenableReference(
return new Reference(
this._database,
`${this.path}/${generatePushID(this._database._serverTimeOffset)}`
);
}
const newRef = new ThenableReference(
const newRef = new Reference(
this._database,
`${this.path}/${generatePushID(this._database._serverTimeOffset)}`
);
@ -894,10 +894,10 @@ export default class Reference extends ReferenceBase {
}
// eslint-disable-next-line no-unused-vars
declare class ThenableReference<+R> extends Reference {
then<U>(
onFulfill?: (value: R) => Promise<U> | U,
onReject?: (error: any) => Promise<U> | U
): Promise<U>;
catch<U>(onReject?: (error: any) => Promise<U> | U): Promise<R | U>;
}
// class ThenableReference<+R> extends Reference {
// then<U>(
// onFulfill?: (value: R) => Promise<U> | U,
// onReject?: (error: any) => Promise<U> | U
// ): Promise<U>;
// catch<U>(onReject?: (error: any) => Promise<U> | U): Promise<R | U>;
// }