File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,14 @@ type _ToStateRefs<SS> =
6868 * Extracts the return type for `storeToRefs`.
6969 * Will convert any `getters` into `ComputedRef`.
7070 */
71- export type StoreToRefs < SS extends StoreGeneric > = SS extends unknown
72- ? _ToStateRefs < SS > &
73- ToRefs < PiniaCustomStateProperties < StoreState < SS > > > &
74- _ToComputedRefs < StoreGetters < SS > >
75- : never
71+ export type StoreToRefs < SS extends StoreGeneric > =
72+ // NOTE: always trues but the conditional makes the type distributive
73+ // https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
74+ SS extends unknown
75+ ? _ToStateRefs < SS > &
76+ ToRefs < PiniaCustomStateProperties < StoreState < SS > > > &
77+ _ToComputedRefs < StoreGetters < SS > >
78+ : never
7679
7780/**
7881 * Creates an object of references with all the state, getters, and plugin-added
You can’t perform that action at this time.
0 commit comments