From 0468dcc30cddd1e16704486e001ffb39718932d0 Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Fri, 24 Jul 2020 09:08:19 +0200 Subject: [PATCH] Added typings to `get_store_value` --- src/runtime/internal/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts index 3fd0a2b701..f4565e4fc4 100644 --- a/src/runtime/internal/utils.ts +++ b/src/runtime/internal/utils.ts @@ -1,3 +1,5 @@ +import { Readable } from "../store"; + export function noop() {} export const identity = x => x; @@ -60,7 +62,7 @@ export function subscribe(store, ...callbacks) { return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; } -export function get_store_value(store) { +export function get_store_value>(store: S): T { { let value; subscribe(store, _ => value = _)(); return value;