跳转到内容

IoTreeArrayUnit

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

IoTreeArrayUnit<T, MaxDepth>
NameType
get() => UnwrapIo<T>[]
set(next: UnwrapIo<T>[]) => void
push(...items: UnwrapIo<T>[]) => void
pop() => UnwrapIo<T> | undefined
splice(start: number, deleteCount: number, ...items: UnwrapIo<T>[]) => void
sort(compareFn?: (a: UnwrapIo<T>, b: UnwrapIo<T>) => number) => void
commit(fn: (draft: UnwrapIo<T>[]) => void) => void
reduce<R>(reducer: (acc: R, item: IoTreeNode<T, MaxDepth>, index: number) => R, initialValue: R) => R
snapshot() => UnwrapIo<T>[]
subscribe(fn: (v: UnwrapIo<T>[]) => void) => IoUnsubscribe
subscribeUpdate(fn: (u: IoUpdate) => void) => IoUnsubscribe
__@iterator@1659() => Iterator<IoTreeNode<T, MaxDepth>>
import type { IoTreeArrayUnit } from '@iostore/store';
let value!: IoTreeArrayUnit;
console.log(value);
  • 避免在用户文档中展开过于复杂的类型细节。
  • 调整类型别名时注意下游兼容性。
  • packages/io/src/lib/utils/types/types.ts