vueuse / vue-chemistry

Reactified JavaScript functions for Vue
MIT License
392 stars 9 forks source link

Support for Array & Objects #1

Open antfu opened 3 years ago

antfu commented 3 years ago

Support something like

import { map, filter, reduce } from 'vue-chemistry/array'
import { keys, entries, fromEntries } from 'vue-chemistry/object'
mdbetancourt commented 2 years ago

what you think about

import { chainReaction } from 'vue-chemistry'

const filterValue = ref(6);
const arr = chainReaction([1, 2, 3]).map((it) => it * 3).filter((it) => it > filterValue.value)

console.log(arr) // [9]

filterValue.value = 0
console.log(arr) // [3, 6, 9]