We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ff22e6 commit 9edcf2fCopy full SHA for 9edcf2f
packages/vue-apollo-composable/src/useResult.ts
@@ -1,13 +1,15 @@
1
import { Ref, computed } from '@vue/composition-api'
2
3
export function useResult<
4
+ TReturnValue = any,
5
+ TDefaultValue = any,
6
TResult = any
7
> (
8
result: Ref<TResult>,
- defaultValue: any = null,
- pick: (data: TResult) => any = null,
9
+ defaultValue: TDefaultValue = null,
10
+ pick: (data: TResult) => TReturnValue = null,
11
) {
- return computed(() => {
12
+ return computed<TDefaultValue | TReturnValue>(() => {
13
const value = result.value
14
if (value) {
15
if (pick) {
0 commit comments