The disposer of an action middleware.
Any model property.
A data model class declaration, made of a base model and the model interface.
Extract the model id property from the model props.
The default type used by fromSnapshot before processors are applied.
A model prop that maybe / maybe not is optional, depending on if the value can take undefined.
Extracts the instance type of a model class.
A model class declaration, made of a base model and the model interface.
The creation data type of a model.
The data type of a model.
The from snapshot type of a model.
The model id property name.
The snapshot in type of a model property.
The snapshot out type of a model property.
The props of a model.
The to snapshot type of a model.
The transformed creation data type of a model.
The transformed data type of a model.
Disposer function to stop listening to patches.
Disposer function for onSnapshot.
Listener function for onSnapshot.
A model prop that is definitely optional.
Path from a parent to a child.
Property name (if the parent is an object) or index number (if the parent is an array).
Reference ID resolver type.
Type for the callback called when a reference resolved value changes.
Reference resolver type.
The default type used by getSnapshot before processors are applied.
An undo/redo event.
An undo/redo event without attached state.
Callback function for SandboxManager.withSandbox.
Path from a parent to a child (writable).
A property that will be used as model id, accessible through $modelId. Can only be used in models and there can be only one per model.
Key that serves as proxy to the model property designed as 'idProp' (if any).
Key where model snapshots will store model type metadata.
A type that represents an array backed set ArraySet.
Example:
const numberSetType = types.arraySet(types.number)
Value type.
Value type.
A type that represents a data model data. The type referenced in the model decorator will be used for type checking.
Example:
const someDataModelDataType = types.dataModelData(SomeModel)
// or for recursive models
const someDataModelDataType = types.dataModelData<SomeModel>(() => SomeModel)
Data model type.
Model class.
An enum type, based on a TypeScript alike enum object.
Syntactic sugar for types.or(...enum_values.map(types.literal))
Example:
enum Color {
Red = "red",
Green = "green"
}
const colorType = types.enum(Color)
Enum type.
A type that represents frozen data.
Example:
const frozenNumberType = types.frozen(types.number)
const frozenAnyType = types.frozen(types.unchecked<any>())
const frozenNumberArrayType = types.frozen(types.array(types.number))
const frozenUncheckedNumberArrayType = types.frozen(types.unchecked<number[]>())
Type.
Type of the frozen data.
A type that represents a certain value of a primitive (for example an exact number or string).
Example
const hiType = types.literal("hi") // the string with value "hi"
const number5Type = types.literal(5) // the number with value 5
Literal value type.
Literal value.
A type that represents either a type or undefined.
Syntactic sugar for types.or(baseType, types.undefined)
Example:
const numberOrUndefinedType = types.maybe(types.number)
Type.
Type.
A type that represents either a type or null.
Syntactic sugar for types.or(baseType, types.null)
const numberOrNullType = types.maybeNull(types.number)
Type.
Type.
A type that represents a model. The type referenced in the model decorator will be used for type checking.
Example:
const someModelType = types.model(SomeModel)
// or for recursive models
const someModelType = types.model<SomeModel>(() => SomeModel)
Model type.
Model class.
A type that represents a plain object. Note that the parameter must be a function that returns an object. This is done so objects can support self / cross types.
Example:
// notice the ({ ... }), not just { ... }
const pointType = types.object(() => ({
x: types.number,
y: types.number
}))
Type.
Function that generates an object with types.
A type that represents an object-like map ObjectMap.
Example:
const numberMapType = types.objectMap(types.number)
Value type.
Value type.
A type that represents the union of several other types (a | b | c | ...). Accepts a dispatcher that, given a snapshot, returns the type that snapshot is.
Type.
Function that given a snapshot returns the type.
Possible types.
A type that represents the union of several other types (a | b | c | ...).
Example:
const booleanOrNumberType = types.or(types.boolean, types.number)
Type.
Possible types.
A type that represents an object-like map, an object with string keys and values all of a same given type.
Example:
// { [k: string]: number }
const numberMapType = types.record(types.number)
Type.
Type of the values of the object-like map.
A type that represents a reference to an object or model.
Example:
const refToSomeObject = types.ref(SomeObject)
Object or model type.
Ref object type.
A refinement over a given type. This allows you to do extra checks over models, ensure numbers are integers, etc.
Example:
const integerType = types.refinement(types.number, (n) => {
return Number.isInteger(n)
}, "integer")
const sumModelType = types.refinement(types.model(Sum), (sum) => {
// imagine that for some reason sum includes a number 'a', a number 'b'
// and the result
const rightResult = sum.a + sum.b === sum.result
// simple mode that will just return that the whole model is incorrect
return rightResult
// this will return that the result field is wrong
return rightResult ? null : new TypeCheckError(["result"], "a+b", sum.result)
})
Base type.
Base type.
Function that will receive the data (if it passes the base type check) and return null or false if there were no errors or either a TypeCheckError instance or true if there were.
A type that represents a given value that won't be type checked. This is basically a way to bail out of the runtime type checking system.
Example:
const uncheckedSomeModel = types.unchecked<SomeModel>()
const anyType = types.unchecked<any>()
const customUncheckedType = types.unchecked<(A & B) | C>()
Type of the value, or unkown if not given.
Base abstract class for data models.
Never override the constructor, use onLazyInit or onLazyAttachedToRootStore instead.
Model properties type.
Function that generates model properties.
Base abstract class for data models.
Never override the constructor, use onLazyInit or onLazyAttachedToRootStore instead.
Model properties type.
Model properties.
Base abstract class for data models that extends another model.
New model properties type.
Model type.
Function that returns the base model and model properties.
Base abstract class for data models that extends another model.
New model properties type.
Model type.
Base model type.
Model properties.
Base abstract class for models that extends another model.
New model properties type.
Model type.
Function that returns the base model and model properties.
Model options.
Base abstract class for models that extends another model.
New model properties type.
Model type.
Base model type.
Model properties.
Model options.
Base abstract class for models.
Never override the constructor, use onInit or onAttachedToRootStore instead.
Model properties type.
Function that generates model properties.
Model options.
Base abstract class for models.
Never override the constructor, use onInit or onAttachedToRootStore instead.
Model properties type.
Model properties.
Model options.
Tricks the TS compiler into thinking that a model flow generator function can be awaited (is a promise).
Function arguments.
Return value.
Flow function.
Tricks the TS compiler into thinking that a model flow generator function can be awaited (is a promise).
Makes a promise a flow, so it can be awaited with yield*.
Promise return type.
Promise.
Abstract model class type.
Abstract model class.
Transforms an action call into a redux action.
Action call.
A redux action.
Creates an action tracking middleware, which is a simplified version of the standard action middleware.
Subtree root target object.
Middleware hooks.
The middleware disposer.
Adds a global action middleware to be run when an action is performed.
It is usually preferable to use onActionMiddleware instead to limit it to a given tree and only to topmost level actions
or actionTrackingMiddleware for a simplified middleware.
Action middleware to be run.
A disposer to cancel the middleware. Note that if you don't plan to do an early disposal of the middleware calling this function becomes optional.
Applies (runs) an action over a target object.
If you intend to apply serialized actions check one of the applySerializedAction methods instead.
Subtree root target object to run the action over.
The action, usually as coming from onActionMiddleware.
The return value of the action, if any.
Deletes an object field wrapped in an action.
Target object.
Field name.
Calls an object method wrapped in an action.
Target object.
Method name.
Applies the given patches to the given target object.
Target object.
List of patches to apply.
Whether patches are applied in reverse order.
Applies (runs) a serialized action over a target object.
In this mode newly generated / modified model IDs previously tracked
by applySerializedActionAndTrackNewModelIds will be synchronized after
the action is applied.
This means this method is usually used on the client side.
If you intend to apply non-serialized actions check applyAction instead.
Subtree root target object to run the action over.
The serialized action, usually as coming from the server/client.
The return value of the action, if any.
Applies (runs) a serialized action over a target object.
In this mode newly generated / modified model IDs will be tracked
so they can be later synchronized when applying it on another machine
via applySerializedActionAndSyncNewModelIds.
This means this method is usually used on the server side.
If you intend to apply non-serialized actions check applyAction instead.
Subtree root target object to run the action over.
The serialized action, usually as coming from the server/client.
The return value of the action, if any, plus a new serialized action with model overrides.
Sets an object field wrapped in an action.
Target object.
Field name.
Value to set.
Applies a full snapshot over an object, reconciling it with the current contents of the object.
Object type.
Target object (model object, object or array).
Snapshot to apply.
Applies a full snapshot over an object, reconciling it with the current contents of the object.
Object type.
Target object (model object, object or array).
Snapshot to apply.
Creates a new ArraySet model instance.
Value type.
Wraps an observable object or a tuple array to offer a map like interface.
Array.
Wraps an observable object or a tuple array to offer a map like interface.
Object.
Generates a redux compatible store out of a mobx-keystone object.
Object type.
Root object.
Optional list of redux middlewares.
A redux compatible store.
Wraps an observable array to offer a set like interface.
Asserts a given object is now a tree node, or throws otherwise.
Value to check.
Argument name, part of the thrown error description.
Clones an object by doing a fromSnapshot(getSnapshot(value), { generateNewIds: true }).
Object type.
Object to clone.
The cloned object.
Decorator for turning a computed property into a computed tree which supports tree traversal functions, contexts, references, etc.
Prototype of the class.
Name of the member.
Property descriptor for the member.
Connects a tree node to a redux dev tools instance.
The remotedev package (usually the result of require("remoteDev")) (https://www.npmjs.com/package/remotedev).
The result of a connect method from the remotedev package (usually the result of remoteDev.connectViaExtension(...)).
Object to use as root.
Creates a custom ref to an object, which in its snapshot form has an id.
Target object type.
Unique model type id.
Custom reference options.
A function that allows you to construct that type of custom reference.
Marks a class (which MUST inherit from the Model abstract class)
as a model and decorates some of its methods/properties.
Unique name for the model type. Note that this name must be unique for your whole
application, so it is usually a good idea to use some prefix unique to your application domain.
If you don't want to assign a name yet (e.g. for a base model) pass undefined.
Model class.
Decorators.
Deeply compares two values.
Supported values are:
Note that in the case of models the result will be false if their model IDs are different.
First value to compare.
Second value to compare.
true if they are the equivalent, false otherwise.
Ensures that an action call is deserialized by mapping the action arguments into its
deserialized version by using deserializeActionCallArgument.
Action call to convert.
The deserialized action call.
Transforms an action call argument by returning its deserialized equivalent.
Argument value to be transformed into its deserialized form.
The deserialized form of the passed value.
Detaches a given object from a tree. If the parent is an object / model, detaching will delete the property. If the parent is an array detaching will remove the node by splicing it. If there's no parent it will throw.
Object to be detached.
Creates a draft copy of a tree node and all its children.
Data type.
Original node.
The draft object.
Iterates through all children and collects them in a set if the given predicate matches.
Root object to get the matching children from.
Function that will be run for every child of the root object.
A readonly observable set with the matching children.
Iterates through all the parents (from the nearest until the root) until one of them matches the given predicate. If the predicate is matched it will return the found node. If none is found it will return undefined.
Parent object type.
Target object.
Function that will be run for every parent of the target object, from immediate parent to the root.
Max depth, or 0 for infinite.
Iterates through all the parents (from the nearest until the root) until one of them matches the given predicate. If the predicate is matched it will return the found node plus the path to get from the parent to the child. If none is found it will return undefined.
Parent object type.
Target object.
Function that will be run for every parent of the target object, from immediate parent to the root.
Max depth, or 0 for infinite.
Given a type deserializes a data structure from its snapshot form.
Object type.
Type.
Snapshot, even if a primitive.
Options.
The deserialized object.
Deserializes a data structure from its snapshot form.
Object type.
Snapshot, even if a primitive.
Options.
The deserialized object.
Marks some data as frozen. Frozen data becomes immutable (at least in dev mode), and is not enhanced with capabilities such as getting the parent of the objects (except for the root object), it is not made deeply observable (though the root object is observable by reference), etc. On the other hand, this means it will be much faster to create/access. Use this for big data pieces that are unlikely to change unless all of them change (for example lists of points for a polygon, etc).
Note that data passed to frozen must be serializable to JSON, this is:
Returns all the children objects (this is, excluding primitives) of an object.
Object to get the list of children from.
A readonly observable set with the children.
Gets the currently running action context, or undefined if none.
Returns the associated metadata for a data model instance or class.
Data model class or instance.
The associated metadata.
Returns the current global config object.
Returns the associated metadata for a model instance or class.
Model class or instance.
The associated metadata.
Uses a model getRefId() method whenever possible to get a reference ID.
If the model does not have an implementation of that method it returns undefined.
If the model has an implementation, but that implementation returns anything other than
a string it will throw.
Target object to get the ID from.
The string ID or undefined.
Returns the sandbox manager of a node, or undefined if none.
Node to check.
The sandbox manager of a node, or undefined if none.
Returns the parent object of the target object, or undefined if there's no parent.
Parent object type.
Target object.
Returns the parent of the target plus the path from the parent to the target, or undefined if it has no parent.
Parent object type.
Target object.
Gets the path to get from a parent to a given child. Returns an empty array if the child is actually the given parent or undefined if the child is not a child of the parent.
Gets all references that resolve to a given object.
Referenced object type.
Node the references point to.
Pass it to filter by only references of a given type, or omit / pass undefined to get references of any type.
Options.
An observable set with all reference objects that point to the given object.
Returns the root of the target object, or itself if the target is a root.
Root object type.
Target object.
Returns the root of the target plus the path from the root to get to the target.
Root object type.
Target object.
Gets the root store of a given tree child, or undefined if none.
Root store type.
Target to find the root store for.
Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.
Object type.
Data structure, including primtives.
The snapshot.
Retrieves an immutable snapshot for a data structure. Since returned snapshots are immutable they will respect shallow equality, this is, if no changes are made then the snapshot will be kept the same.
Object type.
Data structure, including primtives.
The snapshot.
Returns if a given action name is a built-in action, this is, one of:
Action name to check.
true if it is a built-in action, false otherwise.
Returns if the target is a "child" of the tree of the given "parent" object.
Target object.
Parent object.
Returns if a given node is a computed tree node.
Node to check.
true if it is a computed tree node, false otherwise.
Checks if an object is a data model instance.
Returns if the undo recording mechanism is currently disabled.
true if it is currently disabled, false otherwise.
Returns if a given action name corresponds to a hook, this is, one of:
Action name to check.
true if it is a hook, false otherwise.
Checks if an object is a model instance.
Returns if the given function is a model action or not.
Function to check.
Returns if a given object is a model interim data object ($).
Object to check.
true if it is, false otherwise.
Returns if the given function is a model flow or not.
Function to check.
Returns if the target is a "parent" that has in its tree the given "child" object.
Target object.
Child object.
Checks if a ref object is of a given ref type.
Referenced object type.
Reference object.
Reference type.
true if it is of the given type, false otherwise.
Returns if a given object is a root object.
Target object.
Checks if a given object is marked as a root store.
Object.
Returns if a given node is a sandboxed node.
Node to check.
true if it is sandboxed, false
Checks if a given object is now a tree node.
Value to check.
true if it is a tree node, false otherwise.
Converts a JSON pointer into a path.
JSON pointer to convert.
Converted path.
Converts a map to an array. If the map is a collection wrapper it will return the backed array.
Converts a map to an object. If the map is a collection wrapper it will return the backed object.
Decorator that marks this class (which MUST inherit from the Model or DataModel abstract classes)
as a model.
Unique name for the model type. Note that this name must be unique for your whole application, so it is usually a good idea to use some prefix unique to your application domain.
Decorator that turns a function into a model action.
Tricks TypeScript into accepting a particular kind of generic class as a parameter for ExtendedModel.
Does nothing in runtime.
Generic model class type.
Generic model class.
Decorator that turns a function generator into a model flow.
Add missing model metadata to a model creation snapshot to generate a proper model snapshot.
Usually used alongside fromSnapshot.
Model type.
Model class.
Model creation snapshot without metadata.
The model snapshot (including metadata).
Add missing model metadata to a model output snapshot to generate a proper model snapshot.
Usually used alongside applySnapshot.
Model type.
Model class.
Model output snapshot without metadata.
The model snapshot (including metadata).
Creates a new ObjectMap model instance.
Value type.
Attaches an action middleware that invokes a listener for all actions of a given tree.
Note that the listener will only be invoked for the topmost level actions, so it won't run for child actions or intermediary flow steps.
Also it won't trigger the listener for calls to hooks such as onAttachedToRootStore or its returned disposer.
Its main use is to keep track of top level actions that can be later replicated via applyAction somewhere else (another machine, etc.).
There are two kind of possible listeners, onStart and onFinish listeners.
onStart listeners are called before the action executes and allow cancellation by returning a new return value (which might be a return or a throw).
onFinish listeners are called after the action executes, have access to the action actual return value and allow overriding by returning a
new return value (which might be a return or a throw).
If you want to ensure that the actual action calls are serializable you should use either serializeActionCallArgument over the arguments
or serializeActionCall over the whole action before sending the action call over the wire / storing them .
Subtree root target object.
Listener functions that will be invoked everytime a topmost action is invoked on the model or any children.
The middleware disposer.
Runs a callback everytime a new object is attached to a given node. The callback can optionally return a disposer which will be run when the child is detached.
The optional options parameter accepts and object with the following options:
deep: boolean (default: false) - true if the callback should be run for all children deeply
or false if it it should only run for shallow children.fireForCurrentChildren: boolean (default: true) - true if the callback should be immediately
called for currently attached children, false if only for future attachments.Returns a disposer, which has a boolean parameter which should be true if pending detachment callbacks should be run or false otherwise.
Function that returns the object whose children should be tracked.
Callback called when a child is attached to the target object.
Runs a callback everytime a new object is attached to a given node. The callback can optionally return a disposer which will be run when the child is detached.
The optional options parameter accepts and object with the following options:
deep: boolean (default: false) - true if the callback should be run for all children deeply
or false if it it should only run for shallow children.fireForCurrentChildren: boolean (default: true) - true if the callback should be immediately
called for currently attached children, false if only for future attachments.Returns a disposer, which has a boolean parameter which should be true if pending detachment callbacks should be run or false otherwise.
Adds a listener that will be called every time a patch is generated anywhere.
Usually prefer using onPatches.
The listener function that will be called everytime a patch is generated anywhere.
A disposer to stop listening to patches.
Adds a listener that will be called every time a patch is generated for the tree of the given target object.
Subtree root object of the patch listener.
The listener function that will be called everytime a patch is generated for the object or its children.
A disposer to stop listening to patches.
Adds a reaction that will trigger every time an snapshot changes.
Object type.
Object to get the snapshot from or a function to get it.
Function that will be triggered when the snapshot changes.
A disposer.
Creates a patch recorder.
The patch recorder.
Converts a path into a JSON pointer.
Path to convert.
Converted JSON pointer.
Defines a model property, with an optional function to generate a default value
if the input snapshot / model creation data is null or undefined.
Example:
x: prop(() => 10) // an optional number, with a default value of 10
x: prop<number[]>(() => []) // an optional number array, with a default empty array
Value type.
Default value generator function.
Defines a model property, with an optional default value
if the input snapshot / model creation data is null or undefined.
You should only use this with primitive values and never with object values
(array, model, object, etc).
Example:
x: prop(10) // an optional number, with a default value of 10
Value type.
Default primitive value.
Defines a model property with no default value.
Example:
x: prop<number>() // a required number
x: prop<number | undefined>() // an optional number, which defaults to undefined
Value type.
Attaches an action middleware that will throw when any action is started over the node or any of the child nodes, thus effectively making the subtree readonly.
It will return an object with a dispose function to remove the middleware and a allowWrite function
that will allow actions to be started inside the provided code block.
Example:
// given a model instance named todo
const { dispose, allowWrite } = readonlyMiddleware(todo)
// this will throw
todo.setDone(false)
await todo.setDoneAsync(false)
// this will work
allowWrite(() => todo.setDone(false))
// note: for async always use one action invocation per allowWrite!
await allowWrite(() => todo.setDoneAsync(false))
Subtree root target object.
An object with the middleware disposer (dispose) and a allowWrite function.
Registers a new action call argument serializers. Serializers are called in the inverse order they are registered, meaning the latest one registered will be called first.
Serializer to register.
A disposer to unregister the serializer.
Registers a new action call argument serializers. Serializers are called in the inverse order they are registered, meaning the latest one registered will be called first.
A disposer to unregister the serializer.
Registers a model / tree node object as a root store tree. Marking a model object as a root store tree serves several purposes:
onAttachedToRootStore hook (plus disposer) to be invoked on models once they become part of this tree.
These hooks can be used for example to attach effects and serve as some sort of initialization.Object type.
Node object to register as root store.
The same model object that was passed.
Resolves a node given its ID.
Target object type.
Node where to start the search. The search will be done on it and all its children.
ID to search for.
Function that will be used to get the ID from an object (getModelRefId by default).
The node found or undefined if none.
Tries to resolve a path from an object.
Returned value type.
Object that serves as path root.
Path as an string or number array.
An object with { resolved: true, value: T } or { resolved: false }.
Creates a root ref to an object, which in its snapshot form has an id. A root ref will only be able to resolve references as long as both the Ref and the referenced object share a common root.
Target object type.
Unique model type id.
A function that allows you to construct that type of root reference.
Runs a block in unprocted mode, as if it were run inside a model action. Consider using a proper model action instead since these kind of actions are not recorded.
Return type.
Mobx action name.
Action block.
Runs a block in unprocted mode, as if it were run inside a model action. Consider using a proper model action instead since these kind of actions are not recorded.
Return type.
Action block.
Creates a sandbox.
Subtree root target object.
A SandboxManager which allows you to manage the sandbox operations and dispose of the
sandbox.
Ensures that an action call is serializable by mapping the action arguments into its
serializable version by using serializeActionCallArgument.
Action call to convert.
The serializable action call.
Transforms an action call argument by returning a SerializedActionCallArgument.
The following are supported out of the box:
If the value cannot be serialized it will throw an exception.
Argument value to be transformed into its serializable form.
The serializable form of the passed value.
Partially sets the current global config.
Partial object with the new configurations. Options not included in the object won't be changed.
Converts a set to an array. If the set is a collection wrapper it will return the backed array.
Simplifies an action context by converting an async call hierarchy into a simpler one.
Action context to convert.
Simplified action context.
Creates a standalone action. A standalone action must always take an existing tree node as first argument.
Unique action name.
Function.
The function as an standalone action.
Creates a standalone flow. A standalone flow must always take an existing tree node as first argument.
Unique action name.
Function.
The function as an standalone flow.
Defines a string model property with a default value.
Equivalent to tProp(types.string, defaultValue).
Example:
x: tProp("foo") // an optional string that will take the value `"foo"` when undefined.
Default value.
Defines a number model property with a default value.
Equivalent to tProp(types.number, defaultValue).
Example:
x: tProp(42) // an optional number that will take the value `42` when undefined.
Default value.
Defines a boolean model property with a default value.
Equivalent to tProp(types.boolean, defaultValue).
Example:
x: tProp(true) // an optional boolean that will take the value `true` when undefined.
Default value.
Defines a model property, with an optional function to generate a default value
if the input snapshot / model creation data is null or undefined and with an associated type checker.
Example:
x: tProp(types.number, () => 10) // an optional number, with a default value of 10
x: tProp(types.array(types.number), () => []) // an optional number array, with a default empty array
Type checker type.
Type checker.
Default value generator function.
Defines a model property, with an optional default value
if the input snapshot / model creation data is null or undefined and with an associated type checker.
You should only use this with primitive values and never with object values
(array, model, object, etc).
Example:
x: tProp(types.number, 10) // an optional number, with a default value of 10
Type checker type.
Type checker.
Default value generator function.
Defines a model property with no default value and an associated type checker.
Example:
x: tProp(types.number) // a required number
x: tProp(types.maybe(types.number)) // an optional number, which defaults to undefined
Type checker type.
Type checker.
Creates a tag data accessor for a target object of a certain type. Tag data will be lazy created on access and reused for the same target object.
Target type.
Tag data type.
Function that will be called the first time the tag for a given object is requested.
The tag data associated with the target object.
Turns an object (array, plain object) into a tree node,
which then can accept calls to getParent, getSnapshot, etc.
If a tree node is passed it will return the passed argument directly.
Additionally this method will use the type passed to check the value
conforms to the type when model auto type checking is enabled.
Type checker.
Object to turn into a tree node.
The object as a tree node.
Turns an object (array, plain object) into a tree node,
which then can accept calls to getParent, getSnapshot, etc.
If a tree node is passed it will return the passed argument directly.
Object to turn into a tree node.
The object as a tree node.
Transaction middleware as a decorator.
Creates a transaction middleware, which reverts changes made by an action / child actions when the root action throws an exception by applying inverse patches.
Model
Object with the root target model object (model) and root action name (actionName).
The middleware disposer.
Checks if a value conforms to a given type.
Type to check for.
Value to check.
A TypeError if the check fails or null if no error.
Creates an undo middleware.
Subtree root target object.
Optional UndoStore where to store the undo/redo queues. Use this if you want to
store such queues somewhere in your models. If none is provided it will reside in memory.
Extra options, such as how to save / restore certain snapshot of the state to be restored when undoing/redoing.
An UndoManager which allows you to do the manage the undo/redo operations and dispose of the middleware.
Unregisters an object to mark it as no longer a root store.
Node object to unregister as root store.
Walks a tree, running the predicate function for each node. If the predicate function returns something other than undefined, then the walk will be stopped and the function will return the returned value.
Returned object type, defaults to void.
Subtree root object.
Function that will be run for each node of the tree.
Mode to walk the tree, as defined in WalkTreeMode.
Globally skips the undo recording mechanism for the code block that gets run synchronously inside.
Consider using the withoutUndo method of a particular UndoManager instead.
Code block return type.
Code block to run.
The value returned by the code block.
Generated using TypeDoc
Extracts the instance type of an abstract model class.