-
-
Notifications
You must be signed in to change notification settings - Fork 340
New Coding Manual
Single source of truth. Everything that can be computed, should be computed, and in such a way that it will automatically recompute when its underlying inputs change.
Store state vs component state
Keep data/state/derived computations that are shared across features of an application in a global page store. Put feature specific and ephemeral state in "local" component state.
API loaded data should almost always be kept in global stores.
We need to come up with a better way to break up massive stores into smaller stores of concern. This is not trivial.
Class components need to call makeObservable in constructor in order to make observable decorators kick in (this is due to a change in js decorator implementation).
In functional components, we can achieve local observable properties and computed getters using the useLocalObservable hook.
Class components vs Functional (w/ hooks)
CSS modules
Chaining with lodash
MobxView MobxPromise Facade promise