跳转到内容

IoDerived

当你需要复用类型结构时使用此类型别名。

IoDerived<T>
NameType
get() => T
snapshot() => T
subscribe(fn: (v: T) => void) => IoUnsubscribe
import type { IoDerived } from '@iostore/store/derived';
let value!: IoDerived;
console.log(value);
  • 避免在用户文档中展开过于复杂的类型细节。
  • 调整类型别名时注意下游兼容性。
  • packages/io/src/lib/utils/types/types.ts