From 292350f397d48b09b5a09d74b0cec42e1d0c8e2b Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 6 Oct 2024 16:50:12 +0200 Subject: [PATCH] chore: note [skip ci] --- packages/pinia/src/storeToRefs.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/pinia/src/storeToRefs.ts b/packages/pinia/src/storeToRefs.ts index 5b268fc9..9e5dab0e 100644 --- a/packages/pinia/src/storeToRefs.ts +++ b/packages/pinia/src/storeToRefs.ts @@ -68,11 +68,14 @@ type _ToStateRefs = * Extracts the return type for `storeToRefs`. * Will convert any `getters` into `ComputedRef`. */ -export type StoreToRefs = SS extends unknown - ? _ToStateRefs & - ToRefs>> & - _ToComputedRefs> - : never +export type StoreToRefs = + // NOTE: always trues but the conditional makes the type distributive + // https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types + SS extends unknown + ? _ToStateRefs & + ToRefs>> & + _ToComputedRefs> + : never /** * Creates an object of references with all the state, getters, and plugin-added -- 2.47.3