From: Eduardo San Martin Morote Date: Sun, 6 Oct 2024 14:50:12 +0000 (+0200) Subject: chore: note X-Git-Tag: @pinia/nuxt@0.6.0~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=292350f397d48b09b5a09d74b0cec42e1d0c8e2b;p=thirdparty%2Fvuejs%2Fpinia.git chore: note [skip ci] --- 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