v-dollar
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

v-dollar

jQuery-like Vue Reactivity API well-typed!

npm i v-dollar

ref => $
computed => $
watch => $
unref => $
set => $

You are welcome.

Usages

with v-dollar

import { $ } from 'v-dollar'

const counter = $(0)
const doubled = $(() => $(counter) * 2)

const reset = () => $(counter, 0)
const double = () => $(counter, doubled)
const inc = () => counter.value += 1

$(counter, (value) => console.log(value), { flush: 'post' })

w/o v-dollar

import { ref, computed, unref, watch } from 'vue'

const counter = ref(0)
const doubled = computed(() => counter.value * 2)

const reset = () => counter.value = 0
const double = () => counter.value = unref(doubled)
const inc = () => counter.value += 1

watch(counter, (value) => console.log(value), { flush: 'post' })

Why?

FUN.

It's just a toy, don't take it seriously. But yeah, you can use it in prod if you like :p

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i v-dollar

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

5.85 kB

Total Files

6

Last publish

Collaborators

  • antfu