1
- import { writable } from "svelte/store" ;
1
+ import { readable } from "svelte/store" ;
2
2
import { getDownloadURL , list , ref } from "firebase/storage" ;
3
3
4
4
import type {
@@ -31,7 +31,7 @@ export function storageListStore(
31
31
32
32
// Fallback for SSR
33
33
if ( ! globalThis . window ) {
34
- const { subscribe } = writable ( startWith ) ;
34
+ const { subscribe } = readable ( startWith ) ;
35
35
return {
36
36
subscribe,
37
37
reference : null ,
@@ -43,7 +43,7 @@ export function storageListStore(
43
43
console . warn (
44
44
"Cloud Storage is not initialized. Are you missing FirebaseApp as a parent component?"
45
45
) ;
46
- const { subscribe } = writable ( defaultListResult ) ;
46
+ const { subscribe } = readable ( defaultListResult ) ;
47
47
return {
48
48
subscribe,
49
49
reference : null ,
@@ -52,7 +52,7 @@ export function storageListStore(
52
52
53
53
const storageRef = typeof reference === "string" ? ref ( storage , reference ) : reference ;
54
54
55
- const { subscribe } = writable ( startWith , ( set ) => {
55
+ const { subscribe } = readable ( startWith , ( set ) => {
56
56
list ( storageRef ) . then ( ( snapshot ) => {
57
57
set ( snapshot ) ;
58
58
} ) ;
@@ -83,7 +83,7 @@ export function downloadUrlStore(
83
83
84
84
// Fallback for SSR
85
85
if ( ! globalThis . window ) {
86
- const { subscribe } = writable ( startWith ) ;
86
+ const { subscribe } = readable ( startWith ) ;
87
87
return {
88
88
subscribe,
89
89
reference : null ,
@@ -95,7 +95,7 @@ export function downloadUrlStore(
95
95
console . warn (
96
96
"Cloud Storage is not initialized. Are you missing FirebaseApp as a parent component?"
97
97
) ;
98
- const { subscribe } = writable ( null ) ;
98
+ const { subscribe } = readable ( null ) ;
99
99
return {
100
100
subscribe,
101
101
reference : null ,
@@ -104,7 +104,7 @@ export function downloadUrlStore(
104
104
105
105
const storageRef = typeof reference === "string" ? ref ( storage , reference ) : reference ;
106
106
107
- const { subscribe } = writable ( startWith , ( set ) => {
107
+ const { subscribe } = readable ( startWith , ( set ) => {
108
108
getDownloadURL ( storageRef ) . then ( ( snapshot ) => {
109
109
set ( snapshot ) ;
110
110
} ) ;
0 commit comments