codediodeio/sveltefire
소개
사이버네틱하게 강화된 Firebase 앱
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -3
- in 1 month
- -5
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalA minimal, yet powerful library that puts realtime Firebase data into Svelte stores.
Build Complex Apps Faster
SvelteFire allows you to access Firebase Auth, Firestore, Storage, RealtimeDB, and Analytics with minimal complexity. It simplfies relational data with a declarative syntax, handles loading states, automatically disposes of realtime data subscriptions, and more!
Gaze in awe at the example below where we fetch multiple levels of realtime user data with just a few lines of Svelte code:
<!-- 1. 🔥 Firebase App -->
<FirebaseApp {auth} {firestore}>
<!-- 2. 👤 Get the current user -->
<SignedIn let:user>
<p>Howdy, {user.uid}</p>
<!-- 3 (a). 📜 Get a Firestore document owned by a user -->
<Doc ref={`posts/${user.uid}`} let:data={post} let:ref={postRef}>
<h2>{post.title}</h2>
<!-- 4 (a). 💬 Get all the comments in its subcollection -->
<Collection ref={postRef.path + '/comments'} let:data={comments}>
{#each comments as comment}
{/each}
...
Each component in this example above is underpinned by a Svelte store. These custom stores can be used for fine-grained control and to implement your own custom patterns.
Use stores to access Firebase data with Svelte's reactive $ syntax:
<script>
import { docStore } from 'sveltefire';
import { firestore } from '$lib/firebase'; // your firestore instance
const post = docStore(firestore, 'posts/id');
</script>
{$post?.title}
관련 프로젝트 살펴보기
불러오는 중…