Gathering detailed insights and metrics for mobx
Gathering detailed insights and metrics for mobx
npm install mobx
Typescript
Module System
Node Version
NPM Version
99.8
Supply Chain
100
Quality
91.6
Maintenance
100
Vulnerability
100
License
mobx@6.13.6
Updated on Jan 30, 2025
mobx-react@9.2.0
Updated on Dec 11, 2024
mobx-react-lite@4.1.0
Updated on Dec 11, 2024
eslint-plugin-mobx@0.0.13
Updated on Oct 21, 2024
eslint-plugin-mobx@0.0.12
Updated on Oct 20, 2024
mobx@6.13.5
Updated on Oct 16, 2024
TypeScript (54.68%)
JavaScript (42.98%)
HTML (2.04%)
CSS (0.29%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
273,022,941
Last Day
322,781
Last Week
1,687,356
Last Month
6,880,102
Last Year
76,236,711
MIT License
27,724 Stars
3,325 Commits
1,777 Forks
333 Watchers
31 Branches
339 Contributors
Updated on Feb 12, 2025
Minified
Minified + Gzipped
Latest Version
6.13.6
Package Id
mobx@6.13.6
Unpacked Size
4.13 MB
Size
0.98 MB
File Count
134
NPM Version
10.9.2
Node Version
22.13.1
Published on
Jan 30, 2025
Cumulative downloads
Total Downloads
Last Day
1%
322,781
Compared to previous day
Last Week
6.8%
1,687,356
Compared to previous week
Last Month
38.7%
6,880,102
Compared to previous month
Last Year
39%
76,236,711
Compared to previous year
Simple, scalable state management.
Documentation can be found at mobx.js.org.
MobX is made possible by the generosity of the sponsors below, and many other individual backers. Sponsoring directly impacts the longevity of this project.
🥇🥇 Platinum sponsors ($5000+ total contribution): 🥇🥇
🥇 Gold sponsors ($2500+ total contribution):
🥈 Silver sponsors ($500+ total contributions):
Anything that can be derived from the application state, should be. Automatically.
MobX is a signal based, battle-tested library that makes state management simple and scalable by transparently applying functional reactive programming. The philosophy behind MobX is simple:
Write minimalistic, boilerplate-free code that captures your intent. Trying to update a record field? Simply use a normal JavaScript assignment — the reactivity system will detect all your changes and propagate them out to where they are being used. No special tools are required when updating data in an asynchronous process.
All changes to and uses of your data are tracked at runtime, building a dependency tree that captures all relations between state and output. This guarantees that computations that depend on your state, like React components, run only when strictly needed. There is no need to manually optimize components with error-prone and sub-optimal techniques like memoization and selectors.
MobX is unopinionated and allows you to manage your application state outside of any UI framework. This makes your code decoupled, portable, and above all, easily testable.
So what does code that uses MobX look like?
1import React from "react" 2import ReactDOM from "react-dom" 3import { makeAutoObservable } from "mobx" 4import { observer } from "mobx-react-lite" 5 6// Model the application state. 7function createTimer() { 8 return makeAutoObservable({ 9 secondsPassed: 0, 10 increase() { 11 this.secondsPassed += 1 12 }, 13 reset() { 14 this.secondsPassed = 0 15 } 16 }) 17} 18 19const myTimer = createTimer() 20 21// Build a "user interface" that uses the observable state. 22const TimerView = observer(({ timer }) => ( 23 <button onClick={() => timer.reset()}>Seconds passed: {timer.secondsPassed}</button> 24)) 25 26ReactDOM.render(<TimerView timer={myTimer} />, document.body) 27 28// Update the 'Seconds passed: X' text every second. 29setInterval(() => { 30 myTimer.increase() 31}, 1000)
The observer
wrapper around the TimerView
React component will automatically detect that rendering
depends on the timer.secondsPassed
observable, even though this relationship is not explicitly defined. The reactivity system will take care of re-rendering the component when precisely that field is updated in the future.
Every event (onClick
/ setInterval
) invokes an action (myTimer.increase
/ myTimer.reset
) that updates observable state (myTimer.secondsPassed
).
Changes in the observable state are propagated precisely to all computations and side effects (TimerView
) that depend on the changes being made.
This conceptual picture can be applied to the above example, or any other application using MobX.
To learn about the core concepts of MobX using a larger example, check out The gist of MobX page, or take the 10 minute interactive introduction to MobX and React. The philosophy and benefits of the mental model provided by MobX are also described in great detail in the blog posts UI as an afterthought and How to decouple state and UI (a.k.a. you don’t need componentWillMount).
The MobX Quick Start Guide ($24.99) by Pavan Podila and Michel Weststrate is available as an ebook, paperback, and on the O'Reilly platform (see preview).
MobX is inspired by reactive programming principles, which are for example used in spreadsheets. It is inspired by model–view–viewmodel frameworks like MeteorJS's Tracker, Knockout and Vue.js, but MobX brings transparent functional reactive programming (TFRP, a concept which is further explained in the MobX book) to the next level and provides a standalone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
A ton of credit goes to Mendix, for providing the flexibility and support to maintain MobX and the chance to prove the philosophy of MobX in a real, complex, performance critical applications.
No vulnerabilities found.
Reason
8 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
Found 15/18 approved changesets -- score normalized to 8
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
99 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-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