svelte-firebase-state
Firebase utilities for Svelte 5.
Svelte Playground ->svelte-firebase-state simplifies Firebase integration in Svelte/Sveltekit applications by providing easy-to-use reactive state classes for managing Firestore and Realtime Database data. These classes handle data fetching, live updates, user-specific queries and state management, allowing you to focus on your app's logic instead of Firebase boilerplate.
Usage
1. Install the library with your favorite package manager.
2. In your svelte component, import and create an instance of CollectionState, DocumentState, NodeState, or NodeListState, passing configuration options like Firestore,
Authentication, query functions, or database paths.
You can also instantiate the state class in a .svelte.ts file making it global
to your app, in this case the data will be fetched only when the state is subscribed to (shown in a component ui or used in a reactive environment like $effect).
3. Access svelte 5 reactive state with the "data" property of the instance.
If you use the "listen" param, when your database receive updates your UI will
be re-rendered with the correct data.
4. Perform CRUD Operations using class methods.