# ✨ usePick
The
usePick ()
function is used to return a copy of the filtered object using the givenkey
value. This function provides the desired condition by specifying which properties are selected from the object.
# 🍁 Usage
The example usage of usePick
function is shown below.
import { usePick } from 'vue-composable-utils';
const pick = usePick({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'd']);
# 🚀 Features
usePick
takes two parameters.
Parameter | Description |
---|---|
Object | The object to be processed. |
Keys | Optional. The key value that should be selected. |
# 💐 Example
You can see how it changes reactively using the example below.
{"a":1,"d":4}