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

Function createStorageRef

src/compat/storage/ref.ts:25–54  ·  view source on GitHub ↗
(
  ref: Reference,
  injector?: Injector
)

Source from the content-addressed store, hash-verified

23 * creates observable methods from promise based methods.
24 */
25export function createStorageRef(
26 ref: Reference,
27 injector?: Injector
28): AngularFireStorageReference {
29 return {
30 getDownloadURL: () => of(undefined).pipe(
31 observeOn(injector.get(ɵAngularFireSchedulers).outsideAngular),
32 switchMap(() => ref.getDownloadURL()),
33 pendingUntilEvent(injector)
34 ),
35 getMetadata: () => of(undefined).pipe(
36 observeOn(injector.get(ɵAngularFireSchedulers).outsideAngular),
37 switchMap(() => ref.getMetadata()),
38 pendingUntilEvent(injector)
39 ),
40 delete: () => from(ref.delete()),
41 child: (path: string) => createStorageRef(ref.child(path), injector),
42 updateMetadata: (meta: SettableMetadata) => from(ref.updateMetadata(meta)),
43 put: (data: any, metadata?: UploadMetadata) => {
44 const task = ref.put(data, metadata);
45 return createUploadTask(task);
46 },
47 putString: (data: string, format?: StringFormat, metadata?: UploadMetadata) => {
48 const task = ref.putString(data, format, metadata);
49 return createUploadTask(task);
50 },
51 list: (options?: ListOptions) => from(ref.list(options)),
52 listAll: () => from(ref.listAll())
53 };
54}

Callers 3

refMethod · 0.90
refFromURLMethod · 0.90
uploadMethod · 0.90

Calls 11

createUploadTaskFunction · 0.90
getDownloadURLMethod · 0.80
getMetadataMethod · 0.80
childMethod · 0.80
updateMetadataMethod · 0.80
putMethod · 0.80
putStringMethod · 0.80
listAllMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
listMethod · 0.65

Tested by

no test coverage detected