🔥 Firebase Svelte v2

<Node>

Props

  • rtdb?: Database - The realtime database instance, optional if you put the <FirebaseApp> component at the root of your app, or higher than where you're using this component.
  • ref: string | DatabaseReference<Data> - The node reference to create the store from. Can be a string, just like posts/123 or a DatabaseReference object, using the ref database function.
  • startValue?: Data - The initial value of the store. This is useful if you want to avoid a loading state. The `Data` type is inferred from what data you give it.
  • log: boolean = false - If true, the store will log additional information to the console.
  • once: boolean = false - If true, the store will only fetch the data once, and will not update when the data changes.

Slots & Props

default

The default slot is rendered when data is found.

  • data: Data - The data object from the database.
  • ref: DatabaseReference<Data> | null - The database reference you gave.
  • error: Error | null - Error if any.

loading

The loading slot. This is rendered while the data is fetching.

fallback

The fallback slot. This is rendered when the data is not found.