Skip to content

Commit 3b4d53e

Browse files
authored
fix(store): add missing derived type definition (#6172)
1 parent 5c309a5 commit 3b4d53e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/runtime/store/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ export function derived<S extends Stores, T>(
133133
initial_value?: T
134134
): Readable<T>;
135135

136+
/**
137+
* Derived value store by synchronizing one or more readable stores and
138+
* applying an aggregation function over its input values.
139+
*
140+
* @param stores - input stores
141+
* @param fn - function callback that aggregates the values
142+
* @param initial_value - initial value
143+
*/
144+
export function derived<S extends Stores, T>(
145+
stores: S,
146+
fn: (values: StoresValues<S>) => T,
147+
initial_value?: T
148+
): Readable<T>;
149+
136150
/**
137151
* Derived value store by synchronizing one or more readable stores and
138152
* applying an aggregation function over its input values.

0 commit comments

Comments
 (0)