Files
voidarc-homepage/node_modules/.vite/deps_ssr/utils-B9o6NEeQ.js
2026-11-02 12:42:04 +00:00

21 lines
634 B
JavaScript

import { ar as noop, d as untrack } from "./runtime-DInTlc-h.js";
// node_modules/svelte/src/store/utils.js
/** @import { Readable } from './public' */
/**
* @template T
* @param {Readable<T> | null | undefined} store
* @param {(value: T) => void} run
* @param {(value: T) => void} [invalidate]
* @returns {() => void}
*/
function subscribe_to_store(store, run, invalidate) {
if (store == null) {
run(void 0);
if (invalidate) invalidate(void 0);
return noop;
}
const unsub = untrack(() => store.subscribe(run, invalidate));
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
}
export { subscribe_to_store as t };