Skip to content

Commit 7143318

Browse files
committed
Updated readme
1 parent b168657 commit 7143318

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,47 @@ Collections can also take a Firestore Query instead of a path:
279279
</Collection>
280280
```
281281

282+
### DownloadLink
283+
284+
DownloadLink provides a `link` to download a file from Firebase Storage and its `reference`.
285+
286+
```svelte
287+
<DownloadLink ref={item} let:link let:ref>
288+
<a href="{link}" download>Download {ref?.name}</a>
289+
</DownloadLink>
290+
```
291+
292+
### StorageList
293+
294+
StorageList provides a list of `items` and `prefixes` corresponding to the list of objects and sub-folders at a given Firebase Storage path.
295+
296+
```svelte
297+
<StorageList ref="/" let:list>
298+
<ul>
299+
{#if list === null}
300+
<li>Loading...</li>
301+
{:else if list.prefixes.length === 0 && list.items.length === 0}
302+
<li>Empty</li>
303+
{:else}
304+
<!-- Listing the prefixes -->
305+
{#each list.prefixes as prefix}
306+
<li>
307+
{prefix.name}
308+
</li>
309+
{/each}
310+
<!-- Listing the objects in the given folder -->
311+
{#each list.items as item}
312+
<li>
313+
{item.name}
314+
</li>
315+
{/each}
316+
{/if}
317+
</ul>
318+
</StorageList>
319+
```
320+
321+
You can combine
322+
282323
### Using Components Together
283324

284325
These components can be combined to build complex realtime apps. It's especially powerful when fetching data that requires the current user's UID or a related document's path.

0 commit comments

Comments
 (0)