MCPcopy
hub / github.com/angular/angularfire / createRemoveMethod

Function createRemoveMethod

src/compat/database/list/remove.ts:6–15  ·  view source on GitHub ↗
(ref: DatabaseReference)

Source from the content-addressed store, hash-verified

4// TODO(davideast): Find out why TS thinks this returns firebase.Primise
5// instead of Promise.
6export function createRemoveMethod<T>(ref: DatabaseReference) {
7 return function remove(item?: FirebaseOperation): any {
8 if (!item) { return ref.remove(); }
9 return checkOperationCases(item, {
10 stringCase: () => ref.child(item as string).remove(),
11 firebaseCase: () => (item as DatabaseReference).remove(),
12 snapshotCase: () => (item as DatabaseSnapshot<T>).ref.remove()
13 });
14 };
15}

Callers 1

createListReferenceFunction · 0.90

Calls 3

checkOperationCasesFunction · 0.90
childMethod · 0.80
removeMethod · 0.65

Tested by

no test coverage detected