Node
The Node
component is a wrapper around the nodeStore
. It renders the node data and handles the loading state.
Props
path
- RealtimeDB path string (e.g.posts/hi-mom
)startWith
- (optional) initial value to use before the data is fetched
Slots
default
- The node dataloading
- Loading state
Slot Props
data
- The node datapath
- The Database referencertdb
- The Database instance
Example
<script>
import { Node } from 'sveltefire';
</script>
<Node path={'posts/id'} let:data>
<p>{data?.title}</p>
<p slot="loading">Loading...</p>
</Node>