file upload

This commit is contained in:
grngxd 2025-07-31 23:05:55 +01:00
parent 1599371df5
commit aaaebc20a5
5 changed files with 62 additions and 17 deletions

View file

@ -14,8 +14,8 @@ function writeable<T>(store: Atom<T> | WritableAtom<T>): store is WritableAtom<T
return typeof (store as WritableAtom<T>).set === 'function';
}
export function useNanostoreQrl<T>(qrl: QRL<WritableAtom<T> | Atom<T>>): Signal<T> {
const signal = useSignal<T | undefined>(undefined);
export function useNanostoreQrl<T>(qrl: QRL<WritableAtom<T> | Atom<T>>, defaultValue?: T): Signal<T> {
const signal = useSignal<T | undefined>(defaultValue);
const storeSignal = useSignal<NoSerialize<WritableAtom<T> | Atom<T>> | undefined>(undefined);
useTask$(async ({ track }) => {