Skip to content

Conversation

pikax
Copy link
Member

@pikax pikax commented Apr 23, 2020

expose return type for toRefs

Some Typescript users might have some trouble when using reactive and with toRefs

interface Foo {
  a: number,
  b: number
}

interface FooReturn {
  foo: ToRefs<Foo> // naming might be confusing, suggestions welcome
}

function useFoo(){
  const state = reactive({
    a: { a:1, b:2}
  })

  return {
     foo: toRefs(state.a)
  }
}

@yyx990803 yyx990803 merged commit 28b4c31 into vuejs:master Apr 24, 2020
pikax added a commit to pikax/vue-next that referenced this pull request Apr 29, 2020
@pikax pikax deleted the types/export-torefs-type branch May 6, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants