MCPcopy Index your code
hub / github.com/NativeScript/firebase / once

Method once

packages/firebase-database/index.ios.ts:278–300  ·  view source on GitHub ↗
(eventType: EventType, successCallback?: (a: DataSnapshot, b: string) => any, failureCallbackContext?: (a: any) => void | Record<string, any>)

Source from the content-addressed store, hash-verified

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) => {
280 this.native.observeSingleEventOfTypeAndPreviousSiblingKeyWithBlockWithCancelBlock?.(
281 toFIRDataEventType(eventType),
282 (snapshot, key) => {
283 const ss = DataSnapshot.fromNative(snapshot);
284 successCallback?.(ss, key);
285 resolve(ss);
286 },
287 (error) => {
288 failureCallbackContext?.({
289 message: error.localizedDescription,
290 native: error,
291 });
292
293 reject({
294 message: error.localizedDescription,
295 native: error,
296 });
297 }
298 );
299 });
300 }
301
302 orderByChild(path: string): Query {
303 return Query.fromNative(this.native.queryOrderedByChild(path));

Callers

nothing calls this directly

Calls 2

toFIRDataEventTypeFunction · 0.85
fromNativeMethod · 0.45

Tested by

no test coverage detected