🔥 Firebase Svelte v2

createUploadTaskStore()

createUploadTaskStore(storage, ref, data, metadata) creates a store that will upload a file to a reference.

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.
  • data: Blob | Uint8Array | ArrayBuffer
  • metadata?: UploadMetadata - 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 upload to.
  • loading: boolean - When the upload task is loading. (Not when it's uploading!)
  • error: Error | null - Error if any.