mobx-state-tree
Advanced tools
Changelog
1.1.1
Changelog
1.1.0
mst-middlewares
. They are now written in TypeScript and fully transpiled to ES5 to avoid problems with uglifyjs in create-react-app bundling.createActionTrackingMiddleware
, this significantly simplifies writing middleware for common scenarios. Especially middleware that deals with asynchronous actions (flows)process
to flow
. Deprecated process
.process
to now start with flow
.Changelog
1.0.1
atomic
and types TimeTraveller
, UndoManager
. Check out the docs!createActionTrackingMiddleware
to simplify the creation of middleware that support complex async processestypecheck(type, value)
as public api (will ignore environment flags)getEnv
will return an empty object instead of throwing when a tree was initialized without environmentChangelog
0.12.0
mobx-state-tree/middleware/redux
.Changelog
0.11.0
onAction
middleware no longer throws when encountering unserializable arguments. Rather, it serializes a struct like { $MST_UNSERIALIZABLE: true, type: "someType" }
. MST Nodes are no longer automatically serialized. Rather, one should either pass 1: an id, 2: a (relative) path, 3: a snapshotrevertPatch
has been dropped. IReversableJsonPatch
is no longer exposed, instead use the inverse patches generated by onPatch
process_yield
-> process_resume
, process_yield_error
-> process_resume_error
, to make it less confusing how these events relate to yield
statements.patches
has been renamed to rawPatches,
cleanPatchesto
patches, and
inversePatches` was added.decorate(middleware, action)
to easily attach middleware to a specific actiononPatch(handler: (patch, inversePatch) => void)
now receive as second argument the inverse patch of the emitted patchonAction
lister now supports an attachAfter
parameterparentId
(id of the causing action, 0
if none) and tree
(the root of context)union
types in error messagesChangelog
0.10.3
IMiddleWareEvent
, IMiddlewareEventType
, ISerializedActionCall
are now exposed (fixes #315)Changelog
0.10.2
Changelog
0.10.0
preProcessSnapshot
hook is no longer a normal hook that can be defined as action. Instead, it should be defined on the type using types.model(...).preProcessSnapshot(value => value)
process
. See this example or the asynchronous action docs.How to run the codemod?
The codemod is provided as npm package command line tool. It has been written using the TypeScript parser, so it will successfully support either TS or regular JavaScript source files.
To run the codemod, you need to first install it globally by npm install -g mst-codemod-to-0.10
.
After that, the mst-codemod-to-0.10
command will be available in your command line.
To perform the codemod, you need to call in your command line mst-codemod-to-0.10
followed by the filename you want to codemod. A .bak
file with the original source will be created for backup purposes, and the file you provided will be updated to the new syntax! Have fun!
PS: You could also use npx
instead of installing the codemod globally! :)