Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(reactivity): creating type for return toRefs and export return type #1037

Merged
merged 1 commit into from
Apr 24, 2020

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