mirror of
https://github.com/vuejs/apollo.git
synced 2026-01-25 14:17:04 +00:00
fix(type): useResult type inferring 'any' (#872)
This commit is contained in:
parent
5ff22e61e9
commit
9edcf2feb8
@ -1,13 +1,15 @@
|
||||
import { Ref, computed } from '@vue/composition-api'
|
||||
|
||||
export function useResult<
|
||||
TReturnValue = any,
|
||||
TDefaultValue = any,
|
||||
TResult = any
|
||||
> (
|
||||
result: Ref<TResult>,
|
||||
defaultValue: any = null,
|
||||
pick: (data: TResult) => any = null,
|
||||
defaultValue: TDefaultValue = null,
|
||||
pick: (data: TResult) => TReturnValue = null,
|
||||
) {
|
||||
return computed(() => {
|
||||
return computed<TDefaultValue | TReturnValue>(() => {
|
||||
const value = result.value
|
||||
if (value) {
|
||||
if (pick) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user