UNPKG
@cran/lib.vue.ref
Version:
latest (0.2.3)
0.2.3
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
0.0.1
Vue Reactivity Extensions
@cran/lib.vue.ref
/
mjs
/
object
/
useArray.js
12 lines
(11 loc)
•
295 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{ eagerComputed, unwrap }
from
"../utility"
;
/** *
@since
0.2.3 *
@category
Object
*/
export
function
useArray
(
value
) {
return
eagerComputed
(
function
compute
(
) {
const
unwrapped =
unwrap
(value);
return
Array
.
isArray
(unwrapped) ? unwrapped : [unwrapped,]; }); }