🔥 Firebase Svelte v2

createDownloadUrlStore()

createDownloadUrlStore(storage, ref, options) creates a store that will contain the url for a given file.

Parameters

  • storage: FirebaseStorage - The firebase storage instance. If you put the component at the root of your app, or higher than where you're using this store, you can use null or undefined as the parameter and the store will retrieve the database instance from the context.
  • ref: string | StorageReference - The storage reference to the file list.
  • options?: DownloadUrlStoreOptions - Options for the store.

Properties

  • subscribe: ((val: string | null) => void)) => void - Subscribe method for the Svelte store. Allows for the `$store` syntax.
  • ref: StorageReference - The storage reference to the file you want to get.
  • loading: boolean - When the storage reference is loading.
  • error: Error | null - Error if any.

Types

interface DownloadUrlStoreOptions<T> { subscribe: ((val: string | null) => void) => void; ref: StorageReference; loading: boolean; error: Error | null; }