跳转到内容

onMutation

当你需要该包提供的这项行为能力时使用此函数。

(target: unknown, fn: (patch: IoPatch, path: IoPath, update: IoUpdate) => void) => IoUnsubscribe
NameType
targetunknown
fn(patch: IoPatch, path: IoPath, update: IoUpdate) => void

IoUnsubscribe

import { onMutation } from '@iostore/store/debug';
const result = onMutation(/* ...args */);
console.log(result);
  • 调用前请确认参数类型与可空性约束。
  • 注意导入路径与运行环境(服务端/客户端)是否匹配。
  • packages/io/src/lib/utils/debug/debug.ts