(eventType: EventType, callback: (data: DataSnapshot, previousChildKey: string) => void, cancelCallbackOrContext?: (a: any) => void | Record<string, any>, context?: Record<string, any>)
| 254 | } |
| 255 | |
| 256 | on(eventType: EventType, callback: (data: DataSnapshot, previousChildKey: string) => void, cancelCallbackOrContext?: (a: any) => void | Record<string, any>, context?: Record<string, any>): (a: DataSnapshot, b: string) => void { |
| 257 | const handle = this.native?.observeEventTypeAndPreviousSiblingKeyWithBlockWithCancelBlock?.( |
| 258 | toFIRDataEventType(eventType), |
| 259 | (snapshot, key) => { |
| 260 | callback(DataSnapshot.fromNative(snapshot), key); |
| 261 | }, |
| 262 | (error) => { |
| 263 | cancelCallbackOrContext?.({ |
| 264 | message: error.localizedDescription, |
| 265 | native: error, |
| 266 | }); |
| 267 | } |
| 268 | ); |
| 269 | callback['__fbHandle'] = handle; |
| 270 | callback['__fbEventType'] = eventType; |
| 271 | callback['__fbContext'] = context; |
| 272 | |
| 273 | this._handles.set(callback, handle); |
| 274 | |
| 275 | return callback; |
| 276 | } |
| 277 | |
| 278 | once(eventType: EventType, successCallback?: (a: DataSnapshot, b: string) => any, failureCallbackContext?: (a: any) => void | Record<string, any>): Promise<DataSnapshot> { |
| 279 | return new Promise((resolve, reject) => { |
nothing calls this directly
no test coverage detected