Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

jQuery-like Vue Reactivity API

License

NotificationsYou must be signed in to change notification settings

antfu/v-dollar

Repository files navigation

jQuery-like Vue Reactivity API , it's well-typed!

npm i v-dollar

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

You are welcome.

Usages

withv-dollar

import{$}from'v-dollar'constcounter=$(0)constdoubled=$(()=>$(counter)*2)constreset=()=>$(counter,0)constdouble=()=>$(counter,doubled)$(counter,(value)=>console.log(value),{flush:'post'})

w/ov-dollar

import{ref,computed,unref,watch}from'vue'constcounter=ref(0)constdoubled=computed(()=>counter.value*2)constreset=()=>counter.value=0constdouble=()=>counter.value=unref(doubled)watch(counter,(value)=>console.log(value),{flush:'post'})

Or if you prefer this 😈:

import{$as_}from'v-dollar'constcounter=_(0)constdoubled=_(()=>_(counter)*2)constreset=()=>_(counter,0)constdouble=()=>_(counter,doubled)_(counter,(value)=>console.log(value),{flush:'post'})

Why?

FUN.

Don't take it seriously, it's just a toy. But yeah, you can use it in prod if you like, we have nearly 100% test coverage :p

License

MIT

About

jQuery-like Vue Reactivity API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp