All Projects → mobxjs → Mobx

mobxjs / Mobx

Licence: mit
Simple, scalable state management.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to Mobx

Mobx React
React bindings for MobX
Stars: ✭ 4,814 (-80.46%)
Mutual labels:  reactive-programming, mobx
react-mobx-router5
React components for routing solution using router5 and mobx
Stars: ✭ 58 (-99.76%)
Mutual labels:  mobx, reactive-programming
Mobx Vue
🐉 Vue bindings for MobX
Stars: ✭ 401 (-98.37%)
Mutual labels:  reactive-programming, mobx
Hivemq Mqtt Client
HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
Stars: ✭ 402 (-98.37%)
Mutual labels:  reactive-programming
Bangumi
💫 An unofficial bgm.tv app client for Android and iOS, built with React Native. 类似专门做ACG的豆瓣, 已适配 iOS/Android, mobile/Pad, light/dark theme, 并加入了很多独有的增强功能
Stars: ✭ 409 (-98.34%)
Mutual labels:  mobx
Mobx Router
A simple router for MobX + React apps
Stars: ✭ 489 (-98.02%)
Mutual labels:  mobx
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (-97.82%)
Mutual labels:  reactive-programming
Starcabinet
🎉 开源的跨平台Github Stars管理分析工具
Stars: ✭ 399 (-98.38%)
Mutual labels:  mobx
Web Series
📚 现代 Web 开发语法基础与工程实践,涵盖 Web 开发基础、前端工程化、应用架构、性能与体验优化、混合开发、React 实践、Vue 实践、WebAssembly 等多方面。
Stars: ✭ 666 (-97.3%)
Mutual labels:  mobx
Doux
🦄 Immutable reactivity system, made with ES6 Proxy.
Stars: ✭ 460 (-98.13%)
Mutual labels:  reactive-programming
Curriculum
Dive into our 7-month web development program covering HTML, CSS, Javascript, Node, and React!
Stars: ✭ 453 (-98.16%)
Mutual labels:  mobx
Mostly Adequate Guide
Mostly adequate guide to FP (in javascript)
Stars: ✭ 21,330 (-13.42%)
Mutual labels:  reactive-programming
Rfx Stack
RFX Stack - Universal App
Stars: ✭ 427 (-98.27%)
Mutual labels:  mobx
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (-80.82%)
Mutual labels:  reactive-programming
Mobx Persist
persist mobx stores
Stars: ✭ 525 (-97.87%)
Mutual labels:  mobx
Lpdmvvmkit
LPDMvvmKit - Elegant MVVM framework in Objective-C.
Stars: ✭ 400 (-98.38%)
Mutual labels:  reactive-programming
Mobx Angular
MobX connector to Angular
Stars: ✭ 432 (-98.25%)
Mutual labels:  mobx
Viabus Architecture
让 Android 开发可以像流水线一样高效的,职责分离架构 ⚡ 不同于 MVP 的配置解耦,也不能和 似是而非 的 MVVM - Clean 同日而语。VIABUS 是世界范围内首个明确提出,通过职责分离,来真正实现 UI 和 业务并行开发的 Android 项目级开发架构和设计模式理念。
Stars: ✭ 485 (-98.03%)
Mutual labels:  reactive-programming
Reactivemanifesto
The Reactive Manifesto
Stars: ✭ 542 (-97.8%)
Mutual labels:  reactive-programming
Favesound Mobx
🎶 A SoundCloud Client in React + MobX running in production. Live Demo and Source Code to explore React + MobX. Refactored from favesound-redux
Stars: ✭ 532 (-97.84%)
Mutual labels:  mobx

logo

MobX

Simple, scalable state management.

npm version OpenCollective OpenCollective

Discuss on Github View changelog


Documentation for older unsupported V4/V5 can be found here, but be sure to read about current documentation first.

MobX is made possible by the generosity of the sponsors below, and many other individual backers. Sponsoring directly impacts the longevity of this project.

🥇 Gold sponsors ($3000+ total contribution):
Mendix Frontend Masters Facebook Open Source Auction Frontier Guilded Coinbase Canva

🥈 Silver sponsors ($100+ per month):
CodeFirst DCSL Guidesmiths Bugsnag Curology Modulz Space307

🥉 Bronze sponsors ($500+ total contributions):
mantro GmbH Algolia talentplot DAZN Blokt


Introduction

Anything that can be derived from the application state, should be. Automatically.

MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP). The philosophy behind MobX is simple:

😙
Straightforward

Write minimalistic, boilerplate free code that captures your intent. Trying to update a record field? Use the good old JavaScript assignment. Updating data in an asynchronous process? No special tools are required, the reactivity system will detect all your changes and propagate them out to where they are being used.

🚅
Effortless optimal rendering

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 depending 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.

🤹🏻‍♂️
Architectural freedom

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.

A quick example

So what does code that uses MobX look like?

import React from "react"
import ReactDOM from "react-dom"
import { makeAutoObservable } from "mobx"
import { observer } from "mobx-react"

// Model the application state.
class Timer {
    secondsPassed = 0

    constructor() {
        makeAutoObservable(this)
    }

    increase() {
        this.secondsPassed += 1
    }

    reset() {
        this.secondsPassed = 0
    }
}

const myTimer = new Timer()

// Build a "user interface" that uses the observable state.
const TimerView = observer(({ timer }) => (
    <button onClick={() => timer.reset()}>Seconds passed: {timer.secondsPassed}</button>
))

ReactDOM.render(<TimerView timer={myTimer} />, document.body)

// Update the 'Seconds passed: X' text every second.
setInterval(() => {
    myTimer.increase()
}, 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.

MobX unidirectional flow

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 section, 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).

What others are saying...

Guise, #mobx isn't pubsub, or your grandpa's observer pattern. Nay, it is a carefully orchestrated observable dimensional portal fueled by the power cosmic. It doesn't do change detection, it's actually a level 20 psionic with soul knife, slashing your viewmodel into submission.

After using #mobx for lone projects for a few weeks, it feels awesome to introduce it to the team. Time: 1/2, Fun: 2X

Working with #mobx is basically a continuous loop of me going “this is way too simple, it definitely won’t work” only to be proven wrong

I have built big apps with MobX already and comparing to the one before that which was using Redux, it is simpler to read and much easier to reason about.

The #mobx is the way I always want things to be! It's really surprising simple and fast! Totally awesome! Don't miss it!

Further resources and documentation

The MobX book

Created by Pavan Podila and Michel Weststrate.

Videos

And an all around MobX awesome list.

Credits

MobX is inspired by reactive programming principles as found in the spreadsheets. It is inspired by MVVM frameworks like MeteorJS tracker, knockout and Vue.js, but MobX brings Transparent Functional Reactive Programming to the next level and provides a standalone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.

A ton of credits goes to Mendix, for providing the flexibility and support to maintain MobX and the chance to proof the philosophy of MobX in a real, complex, performance critical applications.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].