heluxjs / helux

A reactive atomic state engine for React like.
https://heluxjs.github.io/helux/
MIT License
1.33k stars 70 forks source link

是否可以添加销毁mutate功能 #161

Closed zhangfisher closed 4 months ago

zhangfisher commented 4 months ago

当前版本: 4.2.7

这样在开发SpeedForm时实现局部表单提交时,在组件的生命周期中需要动态创建mutate,但是不支持销毁mutate的功能。

const ctx = sharex({....}})

const  = stateCtx.mutate({
    desc:"id"
} )

stateCtx.removeMutate(id)
fantasticsoul commented 4 months ago

更新至版本4.3.2+,witness支持cancel调用

const witness = mutate(...);
witness.cancel(); // 取消mutate自动执行
fantasticsoul commented 4 months ago

已支持

zhangfisher commented 4 months ago

收到