mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
17 lines (16 loc) • 487 B
TypeScript
import { Path } from '../parent/pathTypes';
export type Patch = PatchAddOperation<any> | PatchRemoveOperation | PatchReplaceOperation<any>;
export interface PatchBaseOperation {
path: Path;
}
export interface PatchAddOperation<T> extends PatchBaseOperation {
op: "add";
value: T;
}
export interface PatchRemoveOperation extends PatchBaseOperation {
op: "remove";
}
export interface PatchReplaceOperation<T> extends PatchBaseOperation {
op: "replace";
value: T;
}