You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs/refguide/tojs.md: remove deprecated file
* docs/refguide/object-api.md: correct heading size
* docs/refguide/observable.md: Create -> Creating
* docs/intro/installation.md: reorder React bindings paragraph
* docs/react/react-performance.md: sync title with 1st heading
* docs/best/debugging-mobx.md: sync 1st heading with sidebar_label
* docs/refguide/on-become-observed.md: sync title with 1st heading
* docs/refguide/observe.md: add title
* docs/refguide/object-api.md: add title
* docs/refguide/modifiers.md: remove [] from sidebar_label to match others
* docs/refguide/extending.md: add title
* docs/react/react-performance.md: move title before sidebar_label
* docs/faq/migrate-to-6.md: add title
* docs/best/debugging-mobx.md: add title
* docs/best/what-does-mobx-react-to.md: add title
* docs/best/store.md: move title before sidebar_label
* docs/best/decorators.md: add title
* docs/best/what-does-mobx-react-to.md: sync 1st heading with title
* docs/intro/installation.md: italic warning to match others
* docs/best/store.md: sync title and 1st heading with sidebar_label
* docs/react/react-integration.md: add ending quote to import statement
* website/sidebars.json: switch positions of Reactions and Computeds
* website/sidebars.json: rename Introduction to MobX
* docs/intro/how-to-read.md: How to read -> About, friendlier, lol
* docs/react/react-integration.md: add comment mentioning mobx-react
* docs/README.md: 3rd pass
* docs/intro/how-to-read.md: 2nd pass
* docs/intro/installation.md: 6th pass
* docs/intro/how-to-read.md: 3rd pass
* docs/intro/concepts.md: 6th pass
* docs/README.md: Introduction -> About MobX
* website/sidebars.json: MobX -> Introduction
* docs/intro/concepts.md: supports -> uses
* docs/intro/how-to-read.md: MobX -> Introduction
* docs/react/react-performance.md: reword title and 1st heading
* docs/README.md: rework the Further resources section
* docs/README.md: 4th pass
* website/sidebars.json: move react-performance to MobX and React & store on top of Tips & Tricks
* docs/refguide/computed.md: 1st pass
* website/sidebars.json: Configuring MobX -> Configuration
* docs/refguide/computed-with-args.md: 1st pass
* docs/refguide/computed-with-args.md: 2nd pass
* docs/refguide/computed-with-args.md: lower the headings so the right-side menu appears
* docs/refguide/observable.md: 6th pass
* website/sidebars.json: switch MobX-utils with Computeds with arguments
* docs/refguide/computed: 2nd pass
* docs/refguide/computed-with-args.md: 3rd pass
* docs/: make all Tip: Note: Example: bold
* docs/refguide/computed.md: 3rd pass
* docs/refguide/computed.md: 4th pass
* docs/refguide/computed.md: re-comp -> recomp
* docs/README.md: add video React Live 2019, Reinventing MobX by Max Gallo
* website/i18n/en.json: changes to titles and sidebar_label's
* docs/: convert remaining side-effects to majority side effects
* docs/react/react-performance.md: mark as advanced
* docs/refguide/computed.md: add a note about autorun and the Reactions section
* docs/refguide/computed.md: reverse the autorun mention
* docs/: surround all advanced markings with {} as it looks the cleanest all-around
* docs/refguide/autorun.md: 1st pass
* website/core/Footer.js: correct to About MobX & The gist of MobX
* docs/refguide/{action,api}.md: correct advanced markings, side effect & recomp
* docs/: move to a flat dir structure, add notices and links to legacy documents
* docs/observable-state.md: added changes made in commit bd9629f
* docs/: update all references and fix any dead ends
* docs/LINKS.md: capitalize the only lowercase x in MobX
* docs/observable-state.md: correct import of observable -> makeAutoObservable
* docs/api.md: revert API overview -> API Reference
* docs/: convert remaining capitalized words after :** to lowercase
* docs/actions.md: 1st pass
* docs/: mark direct mentions of advanced sections with the icon, like in computeds
* docs/actions.md: 2nd pass
* docs/: convert remaining . leading to lists and examples, to :
* docs/reactions.md: 2nd pass
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ The `observer` wrapper around the `TimerView` React component will automatically
125
125
of the component depends on `timer.secondsPassed`, even though this relationship is not explicitly defined. MobX's reactivity system will make sure the component gets re-rendered when _precisely that_ field is updated in the future.
126
126
127
127
Every event (`onClick` and `setInterval`) invokes an _action_ (`increaseTimer` and `resetTimer` functions) that updates _observable state_ (`secondsPassed` class property).
128
-
Changes in the observable state are propagated precisely to all _computations_ and _side-effects_ (`TimerView` component) that depend on the changes being made.
128
+
Changes in the observable state are propagated precisely to all _computations_ and _sideeffects_ (`TimerView` component) that depend on the changes being made.
@@ -161,6 +161,6 @@ The philosophy and benefits of the mental model provided by MobX are described i
161
161
162
162
## Credits
163
163
164
-
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a stand alone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
164
+
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in 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.
165
165
166
166
A ton of credits for [Mendix](https://github.com/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.
-[mobx-reactor](https://github.com/amsb/mobx-reactor) Connect MobX data stores to functional stateless React components with async actions and unidirectional data flow.
15
15
-[mobx-model](https://github.com/ikido/mobx-model) Simplify mobx data stores that mimic backend models
16
-
-[rx-mobx](https://github.com/chicoxyzzy/rx-mobx) Convert Mobx observables to RxJS and vice versa
16
+
-[rx-mobx](https://github.com/chicoxyzzy/rx-mobx) Convert MobX observables to RxJS and vice versa
@@ -17,7 +17,7 @@ _Simple, scalable state management_
17
17
18
18
---
19
19
20
-
MobX is made possible by the generosity of the sponsors below, and many [individual backers](http://mobxjs.github.io/mobx/backers-sponsors.html#backers). Sponsoring directly impacts the longevity of this project.
20
+
MobX is made possible by the generosity of the sponsors below, and many other [individual backers](http://mobxjs.github.io/mobx/backers-sponsors.html#backers). Sponsoring directly impacts the longevity of this project.
21
21
22
22
**🥇 Gold sponsors (\$3000+ total contribution):** <br/>
@@ -45,7 +45,7 @@ MobX is made possible by the generosity of the sponsors below, and many [individ
45
45
46
46
## Introduction
47
47
48
-
_Anything that can be derived from the application state, should be derived. Automatically._
48
+
_Anything that can be derived from the application state, should be. Automatically._
49
49
50
50
MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP).
51
51
The philosophy behind MobX is simple:
@@ -55,10 +55,9 @@ The philosophy behind MobX is simple:
55
55
<div class="pic">😙</div>
56
56
<div>
57
57
<h5>Straightforward</h5>
58
-
<p>With MobX, you write minimalistic, boilerplate free code that captures your intent:
59
-
Trying to update a record field? Use good old JavaScript assignment.
60
-
Updating data in an asynchronous process? No special tools are required.
61
-
The reactivity system will detect all your changes and propagate them out to where they are being used.
58
+
<p>Write minimalistic, boilerplate free code that captures your intent.
59
+
Trying to update a record field? Use the good old JavaScript assignment.
60
+
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.
62
61
</p>
63
62
</div>
64
63
</div>
@@ -67,9 +66,9 @@ The philosophy behind MobX is simple:
67
66
<div>
68
67
<h5>Effortless optimal rendering</h5>
69
68
<p>
70
-
MobX tracks all updates and usages of your data at runtime, building a dependency tree that captures all relations between state and output.
69
+
All changes to and uses of your data are tracked at runtime, building a dependency tree that captures all relations between state and output.
71
70
This guarantees that computations depending on your state, like React components, run only when strictly needed.
72
-
With MobX, there is no need to manually optimize components using error-prone and sub-optimal techniques like memoization and selectors.
71
+
There is no need to manually optimize components with error-prone and sub-optimal techniques like memoization and selectors.
73
72
</p>
74
73
</div>
75
74
</div>
@@ -103,42 +102,42 @@ class Timer {
103
102
makeAutoObservable(this)
104
103
}
105
104
106
-
increaseTimer() {
105
+
increase() {
107
106
this.secondsPassed+=1
108
107
}
109
108
110
-
resetTimer() {
109
+
reset() {
111
110
this.secondsPassed=0
112
111
}
113
112
}
114
113
115
114
constmyTimer=newTimer()
116
115
117
-
// Build a user interface for this app that merely uses the state.
116
+
// Build a "user interface" that uses the observable state.
// Update the 'Seconds passed: X' text every second.
125
124
setInterval(() => {
126
-
myTimer.increaseTimer()
125
+
myTimer.increase()
127
126
}, 1000)
128
127
```
129
128
130
-
The `observer` wrapper around the `TimerView` React component will automatically detect that rendering
131
-
of the component depends on `timer.secondsPassed`, even though this relationship is not explicitly defined. MobX's reactivity system will make sure the component gets re-rendered when _precisely that_ field is updated in the future.
129
+
The `observer` wrapper around the `TimerView` React component, will automatically detect that rendering
130
+
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.
132
131
133
-
Every event (`onClick`and`setInterval`) invokes an _action_ (`increaseTimer` and `resetTimer` functions) that updates _observable state_ (`secondsPassed` class property).
134
-
Changes in the observable state are propagated precisely to all _computations_ and _side-effects_ (`TimerView` component) that depend on the changes being made.
132
+
Every event (`onClick`/`setInterval`) invokes an _action_ (`myTimer.increase` / `myTimer.reset`) that updates _observable state_ (`myTimer.secondsPassed`).
133
+
Changes in the observable state are propagated precisely to all _computations_ and _sideeffects_ (`TimerView`) that depend on the changes being made.
You can apply this diagram as a conceptual picture to this simple example or any other application using MobX.
137
+
This conceptual picture can be applied to the above example, or any other application using MobX.
139
138
140
-
To learn about the core concepts of MobX with a larger example, please read [Concepts & Principles](http://mobxjs.github.io/mobx/intro/concepts.html)or take the [10 minute interactive introduction to MobX and React](https://mobx.js.org/getting-started).
141
-
The philosophy and benefits of the mental model provided by MobX are described in detail in the blogs[UI as an afterthought](https://michel.codes/blogs/ui-as-an-afterthought) and [How to decouple state and UI (a.k.a. you don’t need componentWillMount)](https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37).
139
+
To learn about the core concepts of MobX using a larger example, check out [The gist of MobX](the-gist-of-mobx.md) section, or take the [10 minute interactive introduction to MobX and React](https://mobx.js.org/getting-started.html).
140
+
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](https://michel.codes/blogs/ui-as-an-afterthought) and [How to decouple state and UI (a.k.a. you don’t need componentWillMount)](https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37).
142
141
143
142
## What others are saying...
144
143
@@ -154,19 +153,26 @@ The philosophy and benefits of the mental model provided by MobX are described i
- <i><astyle="color: white; background:green;padding:5px;margin:5px;border-radius:2px"href="https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx">egghead.io course</a></i> (Based on MobX 3)
159
-
- <imgsrc="assets/book.jpg"height="80px"/> [The MobX book](https://books.google.nl/books?id=ALFmDwAAQBAJ&pg=PP1&lpg=PP1&dq=michel+weststrate+mobx+quick+start+guide:+supercharge+the+client+state+in+your+react+apps+with+mobx&source=bl&ots=D460fxti0F&sig=ivDGTxsPNwlOjLHrpKF1nweZFl8&hl=nl&sa=X&ved=2ahUKEwiwl8XO--ncAhWPmbQKHWOYBqIQ6AEwAnoECAkQAQ#v=onepage&q=michel%20weststrate%20mobx%20quick%20start%20guide%3A%20supercharge%20the%20client%20state%20in%20your%20react%20apps%20with%20mobx&f=false) by Pavan Podila and Michel Weststrate.
160
-
- Videos:
161
-
-[Introduction to MobX & React in 2020](https://www.youtube.com/watch?v=pnhIJA64ByY) - 17m by Leigh Halliday.
162
-
-[ReactNext 2016: Real World MobX](https://www.youtube.com/watch?v=Aws40KOx90U) - 40m [slides](https://docs.google.com/presentation/d/1DrI6Hc2xIPTLBkfNH8YczOcPXQTOaCIcDESdyVfG_bE/edit?usp=sharing)
163
-
-[Practical React with MobX](https://www.youtube.com/watch?v=XGwuM_u7UeQ). In depth introduction and explanation to MobX and React by Matt Ruby on OpenSourceNorth (ES5 only) - 42m.
164
-
-[MobX and the unique symbiosis of predictability and speed](https://www.youtube.com/watch?v=NBYbBbjZeX4&list=PL8sJahqnzh8JJD7xahG5zXkjfM5GOgcPA&index=21&t=0s) - HolyJS 2019 conf, 59 min
165
-
-[Talk: State Management Is Easy, React Amsterdam 2016 conf](https://www.youtube.com/watch?v=ApmSsu3qnf0&feature=youtu.be) ([slides](https://speakerdeck.com/mweststrate/state-management-is-easy-introduction-to-mobx))
Created by [Pavan Podila](https://twitter.com/pavanpodila) and [Michel Weststrate](https://twitter.com/mweststrate).
163
+
164
+
### Videos
165
+
-[Introduction to MobX & React in 2020](https://www.youtube.com/watch?v=pnhIJA64ByY) by Leigh Halliday, _17min_.
166
+
-[ReactNext 2016: Real World MobX](https://www.youtube.com/watch?v=Aws40KOx90U) by Michel Weststrate, _40min_, [slides](https://docs.google.com/presentation/d/1DrI6Hc2xIPTLBkfNH8YczOcPXQTOaCIcDESdyVfG_bE/edit?usp=sharing).
167
+
-[OpenSourceNorth: Practical React with MobX (ES5)](https://www.youtube.com/watch?v=XGwuM_u7UeQ) by Matt Ruby, _42min_.
168
+
-[HolyJS 2019: MobX and the unique symbiosis of predictability and speed](https://www.youtube.com/watch?v=NBYbBbjZeX4&list=PL8sJahqnzh8JJD7xahG5zXkjfM5GOgcPA&index=21&t=0s) by Michel Weststrate, _59min_.
169
+
-[React Amsterdam 2016: State Management Is Easy](https://www.youtube.com/watch?v=ApmSsu3qnf0&feature=youtu.be) by Michel Weststrate, _20min_, [slides](https://speakerdeck.com/mweststrate/state-management-is-easy-introduction-to-mobx).
170
+
- {🚀} [React Live 2019: Reinventing MobX](https://www.youtube.com/watch?v=P_WqKZxpX8g) by Max Gallo, _27min_.
171
+
172
+
And an all around [MobX awesome list](https://github.com/mobxjs/awesome-mobx#awesome-mobx).
167
173
168
174
## Credits
169
175
170
-
MobX is inspired by reactive programming principles as found in spreadsheets. It is inspired by MVVM frameworks like in MeteorJS tracker, knockout and Vue.js. But MobX brings Transparent Functional Reactive Programming to the next level and provides a stand alone implementation. It implements TFRP in a glitch-free, synchronous, predictable and efficient manner.
176
+
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.
171
177
172
-
A ton of credits for[Mendix](https://github.com/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.
178
+
A ton of credits goes to[Mendix](https://github.com/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.
It follows the principle that the most commonly used concepts are
12
+
introduced before specialized information. This applies to the headings in the table
13
+
of concepts as well as the pages under those headings.
14
+
15
+
We've marked the sections and concepts that are more advanced with the {🚀} marker. You likely won't have to understand them until you will have a special use case, and can use MobX very effectively without knowing about them. Feel free to skip them and move on to the next section!
16
+
17
+
The documentation has been rewritten for MobX 6. For older versions of MobX, it can be found [here](https://github.com/mobxjs/mobx/tree/mobx4and5/docs).
18
+
All the principles are the same, and the API is largely the same. The main difference is that before MobX 6, [decorators](https://github.com/mobxjs/mobx/blob/mobx4and5/docs/best/decorators.md) were the recommended syntax to write MobX enhanced classes.
19
+
20
+
## Guided tour
21
+
22
+
To get an overall idea of how to use MobX with React, read through the current _Introduction_ heading, in particular [The gist of MobX](the-gist-of-mobx.md) section.
23
+
It will introduce you to the most important principles, API's and how they relate.
24
+
You should be ready to use MobX once you read this!
25
+
26
+
Here are a few suggestions about the next things to check out:
27
+
28
+
- Try the [10 minute interactive introduction to MobX and React](getting-started.html)
0 commit comments