1.1.6 • Published 3 years ago

@micro-cube/reactive v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

REACTIVE

简介

基于 FunctionProxy 的响应式核心

安装

# npm
npm i @micro-cube/reactive
# or yarn
yarn i @micro-cube/reactive
# or pnpm
pnpm i @micro-cube/reactive

案例

import { useReactive, useEffect } from '@micro-cube/reactive'

// 创建响应式对象
const data = useReactive(1)
let double = NaN

useEffect(() => {
  // 读取data, 不加参数为读取操作
  double = data() * 2
})

console.log(double) // 2

// data写入3,加参数为写入操作
data(3)
console.log(double) // 6

测试

测试用例

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago