helux icon indicating copy to clipboard operation
helux copied to clipboard

A reactive atomic state engine for React like.

Results 17 helux issues
Sort by recently updated
recently updated
newest added

实例中的computed及watch由于签名为字符串数组,是否可以支持props呢,在使用setup中又想监听某些props的变化,而这个限制貌似只有将监听通过内置hook写在组件内部,给人一种很不优雅的感觉。本质上都是监听,却又要通过组件内部来触发settings更新state达到效果。 虽然对于模块的状态在实例中监听可能会多次触发,但某些情况下的衍生数据对于写入模块显得有些小题大做。 理想状态: computed监听state、props、refComputed、moduleState、moduleComputed watch监听state、props、refComputed、moduleState、moduleComputed

enhancement

```tsx function Demo(){ const [ dict, setDict ] = useLocalAtom({ a: 1 }); const [ result ] = useDerived(()=>{ return dict.a + 1; }); useWatchEffect(()=>{ console.log(`found ${dict.a} changed`); }); }...

[v5.0] support [lifecycle](https://github.com/heluxjs/helux/issues/118) [v6.0] support [useLocalAtom](https://github.com/heluxjs/helux/issues/143)

如果我的开源软件碰巧给你提供了帮助,欢迎请我喝杯奶茶吧。 ![image](https://github.com/heluxjs/helux/assets/7334950/8f513646-6a27-45df-a29c-3eb8ac5a559c)

在 https://github.com/krausest/js-framework-benchmark 中提交与其他框架的性能对比

`helux`的一个缺点就是功能太过于强大灵活了,导致在写`mutate`等依赖相关时,很容易出错,比如循环依赖,依赖无效等问题,这些问题原则上不是`helux`的错,开发者需要一个更加友好方便的调试诊断工具。 该调试诊断工具`helux-debug`,`建议以`插件`形式提供,具有如下功能: - mutate日志打印 如打印`[helux] create mutate : deps=["a","b","c"] 这些信息可以更好地提供帮助进行故障诊断 - mutate执行跟踪 能输出`mutate`执行过程中出更加友好的依赖读写日志 ``` [helux ] mutate : deps=["a","b","c"] [helux ] mutate : fn [helux ] mutate : task [helux...

问题描述: `js const [ state ]= share({ xxx: undefined } ) const result = derive(() => { if( !state.xxx ) return; // 前置返回依赖收集会丢失 return state.xxx + 1; }); ` 优化...

新增`lifecycle` api,提供给用户需要根据组件挂载情况来触发逻辑的场景来使用,设计如下: > 以下钩子函数均可按需定义在`lifecycle`中 ```ts defineLifecycle(someAtom)({ // first ins of current atom will mount // 第一个使用当前共享对象的组件实例将要挂载时触发 willMount willMount(params){ // params: { state, stateRoot, setState, setDraft } }, // first ins...

enhancement

3.5.5 开始草稿依赖收集功能默认支持,无需开启,并提供的强大的死循环检测功能,通过 alert 和 控制台输出方式帮用户地位死循环位置 ![image](https://github.com/heluxjs/helux/assets/7334950/2ed8f13a-18f9-4f84-a56c-cd7d97eaa1ba) ## 关闭alert 不配置`alertDeadCycleErr`时,开发环境弹死循环提示,生产环境不弹,支持人工设置 ```ts const x = atomx({ a: 1, b: 2 }, { moduleName: 'yy', alertDeadCycleErr: false }); ``` ## 死循环案例 `helux`能检测以下几种常见的触发死循环情况,并主动阻止无限调用情况产生 ###...

good first issue