Skip to content

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.

2 participants