MCPcopy Create free account
hub / github.com/NativeScript/firebase / off

Method off

packages/firebase-database/index.ios.ts:242–254  ·  view source on GitHub ↗
(eventType?: EventType, callback?: (a: DataSnapshot, b: string) => void, context?: Record<string, any>)

Source from the content-addressed store, hash-verified

240 _handles: Map<(a: DataSnapshot, b: string) => void, number> = new Map();
241
242 off(eventType?: EventType, callback?: (a: DataSnapshot, b: string) => void, context?: Record<string, any>): void {
243 const handle = callback?.['__fbHandle'];
244 const event = callback?.['__fbEventType'];
245 if (typeof handle === 'number' && event === eventType) {
246 if (this._handles.has(callback)) {
247 this.native.removeObserverWithHandle(handle);
248 callback['__fbHandle'] = undefined;
249 callback['__fbEventType'] = undefined;
250 callback['__fbContext'] = undefined;
251 this._handles.delete(callback);
252 }
253 }
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?.(

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.65

Tested by

no test coverage detected