|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
import { Readable } from "../store";
|
|
|
|
|
|
|
|
|
|
|
|
export function noop() {}
|
|
|
|
export function noop() {}
|
|
|
|
|
|
|
|
|
|
|
|
export const identity = x => x;
|
|
|
|
export const identity = x => x;
|
|
|
@ -60,7 +62,7 @@ export function subscribe(store, ...callbacks) {
|
|
|
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
|
|
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function get_store_value(store) {
|
|
|
|
export function get_store_value<T, S extends Readable<T>>(store: S): T { {
|
|
|
|
let value;
|
|
|
|
let value;
|
|
|
|
subscribe(store, _ => value = _)();
|
|
|
|
subscribe(store, _ => value = _)();
|
|
|
|
return value;
|
|
|
|
return value;
|
|
|
|