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

feat: add unref API to match API with vue3 #309

Closed
wants to merge 1 commit into from

Conversation

pikax
Copy link
Member

@pikax pikax commented Apr 19, 2020

Same implementation as vue-next

https://github.com/vuejs/vue-next/blob/a51b05267231fb1770d6fc727bc276475c21d27f/packages/reactivity/src/ref.ts#L69-L71

export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {
  return isRef(ref) ? (ref.value as any) : ref
}

@pikax
Copy link
Member Author

pikax commented Apr 19, 2020

merged into #309

@casprwang
Copy link

can we make a release for this API? It's fairly useful.

@antfu antfu mentioned this pull request Jun 3, 2020
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.

None yet

2 participants