Jump to top

TaskSnapshotObserver

interface

The snapshot observer returned from a Task#on listener.

Example
const ref = firebase.storage().ref(...);
const task = ref.put(...)

task.on('state_changed', {
  next(taskSnapshot) {
    console.log(taskSnapshot.state);
  },
  error(error) {
    console.error(error.message);
  },
  complete() {
    console.log('Task complete');
  },
})

Properties

complete

</>

Called when the task has completed successfully.

complete: () => void;

error

</>

Called when the task errors.

error: (error: NativeFirebaseError) => void;

next

</>

Called when the task state changes.

next: (taskSnapshot: TaskSnapshot) => void;