Gathering detailed insights and metrics for mobx-keystone
Gathering detailed insights and metrics for mobx-keystone
Gathering detailed insights and metrics for mobx-keystone
Gathering detailed insights and metrics for mobx-keystone
mobx-keystone-yjs
Yjs bindings for mobx-keystone
mobx-keystone-asyncstore
An opinionated asynchronous store and container implementation for mobx-keystone.
ts-transform-async-to-mobx-keystone-flow
Typescript transformer for converting async functions into generators wrapped with mobx keystone flow
mobx-keystone-persist
Persist and hydrate mobx-keystone stores
npm install mobx-keystone
Typescript
Module System
Node Version
NPM Version
91.4
Supply Chain
96.5
Quality
89.2
Maintenance
100
Vulnerability
100
License
TypeScript (87.68%)
MDX (12.1%)
JavaScript (0.13%)
CSS (0.1%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,074,485
Last Day
2,183
Last Week
9,282
Last Month
41,797
Last Year
397,940
MIT License
570 Stars
1,292 Commits
25 Forks
9 Watchers
8 Branches
14 Contributors
Updated on Mar 11, 2025
Latest Version
1.11.3
Package Id
mobx-keystone@1.11.3
Unpacked Size
4.23 MB
Size
0.98 MB
File Count
385
NPM Version
11.0.0
Node Version
23.6.0
Published on
Mar 11, 2025
Cumulative downloads
Total Downloads
Last Day
62.7%
2,183
Compared to previous day
Last Week
7.4%
9,282
Compared to previous week
Last Month
18.9%
41,797
Compared to previous month
Last Year
42.7%
397,940
Compared to previous year
4
1
A MobX powered state management solution based on data trees with first-class support for TypeScript, snapshots, patches and much more
Full documentation can be found on the site:
mobx-keystone.js.org
mobx-keystone
are now available in the mobx-keystone-yjs
package as well as a working example in the examples section of the online docs.mobx-keystone
is a state container that combines the simplicity and ease of mutable data with the traceability of immutable data and the reactiveness and performance of observable data, all with a fully compatible TypeScript syntax.
Simply put, it tries to combine the best features of both immutability (transactionality, traceability and composition) and mutability (discoverability, co-location and encapsulation) based approaches to state management; everything to provide the best developer experience possible.
Unlike MobX itself, mobx-keystone
is very opinionated about how data should be structured and updated.
This makes it possible to solve many common problems out of the box.
Central in mobx-keystone
is the concept of a living tree. The tree consists of mutable, but strictly protected objects (models, arrays and plain objects).
From this living tree, immutable, structurally shared snapshots are automatically generated.
Another core design goal of mobx-keystone
is to offer a great TypeScript syntax out of the box, be it for models (and other kinds of data such as plain objects and arrays) or for its generated snapshots.
To see some code and get a glimpse of how it works check the Todo List Example.
Because state trees are living, mutable models, actions are straightforward to write; just modify local instance properties where appropriate. It is not necessary to produce a new state tree yourself, mobx-keystone
's snapshot functionality will derive one for you automatically.
Although mutable sounds scary to some, fear not, actions have many interesting properties. By default trees can only be modified by using an action that belongs to the same subtree. Furthermore, actions are replayable and can be used to distribute changes.
Moreover, because changes can be detected on a fine-grained level, JSON patches are supported out of the box. Simply subscribing to the patch stream of a tree is another way to sync diffs with, for example, back-end servers or other clients.
Since mobx-keystone
uses MobX behind the scenes, it integrates seamlessly with mobx
and mobx-react
.
Even cooler, because it supports snapshots, action middlewares and replayable actions out of the box, it is possible to replace a Redux store and reducer with a MobX data model.
This makes it possible to connect the Redux devtools to mobx-keystone
.
Like React, mobx-keystone
consists of composable components, called models, which capture small pieces of state. They are instantiated from props and after that manage and protect their own internal state (using actions). Moreover, when applying snapshots, tree nodes are reconciled as much as possible.
This library requires a more or less modern JavaScript environment to work, namely one with support for:
In other words, it should work on mostly anything except it won't work in Internet Explorer.
If you are using TypeScript, then version >= 4.2.0 is recommended, though it might work with older versions.
npm install mobx-keystone
yarn add mobx-keystone
No vulnerabilities found.
Reason
27 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More