From 54308f762d64f4d8e1dc05044aea23efb25d7efe Mon Sep 17 00:00:00 2001 From: Fielding Johnston Date: Wed, 7 Apr 2021 14:55:38 -0500 Subject: [PATCH] Add additional function overload for derived --- src/runtime/store/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index 45877d861f59..cf15db5250b9 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -133,6 +133,20 @@ export function derived( initial_value?: T ): Readable; +/** + * Derived value store by synchronizing one or more readable stores and + * applying an aggregation function over its input values. + * + * @param stores - input stores + * @param fn - function callback that aggregates the values + * @param initial_value - initial value + */ +export function derived( + stores: S, + fn: (values: StoresValues) => T, + initial_value?: T +): Readable; + /** * Derived value store by synchronizing one or more readable stores and * applying an aggregation function over its input values.