Skip to content

DanHulton/vue-deepunref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue deepUnref

The counterpart to Vue 3's toRefs, deepUnref will apply unref recursively until you have an object or array that is completely free of refs. Useful for when you need to pass, for example, a "form" object full of refs to a validation library or to a POST endpoint.

Installation

yarn add vue-deepunref npm install vue-deepunref

Usage

import { deepUnref } from 'vue-deepunref';

const form = {
  name: ref('Abc Def'),
  email: ref('abc@def.com'),
}

saveRest({ ...deepUnref(form) });

Notes

deepUnref doesn't work with Set and Map objects

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published