3.0.0-rc.9
https://codesandbox.io/s/bold-fermat-28wgn?file=/src/composition/paginate.ts
Just check the typings errors in the editor, especially at line 28 and 41
my dataTransformer function that returns T[] should be able to assign its return value to data.value
Impossible, typings don't allow me to do that.
This code used to work in @vue/composition-api on version 0.6.
I probably don't understand how some typings work, or maybe I need to cast some values differently.
Generics and ref, you need to cast to T
Check https://github.com/vuejs/vue-next/pull/1129
And https://github.com/microsoft/TypeScript/issues/33942
Also Vue 3 docs https://v3.vuejs.org/guide/typescript-support.html#typing-refs
Ohhh that helped a lot. Thank you very much.
Most helpful comment
Generics and
ref, you need to cast to TCheck https://github.com/vuejs/vue-next/pull/1129
And https://github.com/microsoft/TypeScript/issues/33942
Also Vue 3 docs https://v3.vuejs.org/guide/typescript-support.html#typing-refs