diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index 09040487f0..c8e2b4ff99 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -125,10 +125,12 @@ type StoresValues = T extends Readable ? U : * * @param stores - input stores * @param fn - function callback that aggregates the values + * @param initial_value - when used asynchronously */ export function derived( stores: S, - fn: (values: StoresValues) => T + fn: (values: StoresValues, set: (value: T) => void) => Unsubscriber | void, + initial_value?: T ): Readable; /** @@ -137,12 +139,10 @@ export function derived( * * @param stores - input stores * @param fn - function callback that aggregates the values - * @param initial_value - when used asynchronously */ export function derived( stores: S, - fn: (values: StoresValues, set: (value: T) => void) => Unsubscriber | void, - initial_value?: T + fn: (values: StoresValues) => T ): Readable; export function derived(stores: Stores, fn: Function, initial_value?: T): Readable {