UNPKG

reecho

Version:

Reecho 是一款基于依赖收集的MVVM框架,它具有以下特点 - 声明式数据: 基于proxy的依赖收集 - 使用函数定义组件,但组件不会如React一样重复执行造成心智负担 - 读写分离,读取状态和更改状态统一使用函数,避免vue3的ref一样有时需要`xxx.value`有时不需要的不一致性 - 使用TS编写,类型友好

11 lines (8 loc) 191 B
import { computed } from "./computed"; export function useMemo<T>(fn: () => T): () => T { const ref = computed(fn); function getValue() { return ref.value; } return getValue; }