This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
import { n as noop } from "./index2.js";
|
||||
import { s as safe_not_equal } from "./root.js";
|
||||
import { u as untrack, s as safe_not_equal } from "./root.js";
|
||||
import "clsx";
|
||||
function subscribe_to_store(store, run, invalidate) {
|
||||
if (store == null) {
|
||||
run(void 0);
|
||||
return noop;
|
||||
}
|
||||
const unsub = untrack(
|
||||
() => store.subscribe(
|
||||
run,
|
||||
// @ts-expect-error
|
||||
invalidate
|
||||
)
|
||||
);
|
||||
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||
}
|
||||
const subscriber_queue = [];
|
||||
function readable(value, start) {
|
||||
return {
|
||||
@@ -54,7 +68,13 @@ function writable(value, start = noop) {
|
||||
}
|
||||
return { set, update, subscribe };
|
||||
}
|
||||
function get(store) {
|
||||
let value;
|
||||
subscribe_to_store(store, (_) => value = _)();
|
||||
return value;
|
||||
}
|
||||
export {
|
||||
get as g,
|
||||
readable as r,
|
||||
writable as w
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user