(value?: any, onComplete?: () => void)
| 406 | } |
| 407 | |
| 408 | push(value?: any, onComplete?: () => void): ThenableReference { |
| 409 | const id = this.native.push(); |
| 410 | const thennablePushRef = Reference.fromNative(id); |
| 411 | const pushRef = Reference.fromNative(id); |
| 412 | let promise; |
| 413 | if (value) { |
| 414 | promise = thennablePushRef.set(value, onComplete).then(() => pushRef); |
| 415 | } else { |
| 416 | promise = Promise.resolve(pushRef); |
| 417 | } |
| 418 | |
| 419 | // @ts-ignore |
| 420 | thennablePushRef.then = promise.then.bind(promise); |
| 421 | // @ts-ignore |
| 422 | thennablePushRef.catch = promise.then.bind(promise, undefined); |
| 423 | |
| 424 | if (typeof onComplete === 'function') { |
| 425 | promise.catch(() => {}); |
| 426 | } |
| 427 | |
| 428 | return thennablePushRef as any; |
| 429 | } |
| 430 | |
| 431 | remove(onComplete?: (error: FirebaseError) => void): Promise<void> { |
| 432 | return new Promise((resolve, reject) => { |
nothing calls this directly
no test coverage detected