Working with atoms in mobx
The mobx library has a very interesting primitive atom, which is created via createAtom. With its help, you can create very interesting constructions and build almost the entire architecture of the application. What does the documentation tell us: `createAtom` {🚀} Usage: `createAtom(name, onBecomeObserved?, onBecomeUnobserved?)` Creates your own observable data structure and hooks it up to MobX. Used internally by all observable data types. Atom exposes two `report` methods to notify MobX with when: - `reportObserved()`: the atom has become observed, and should be considered part of the dependency tree of the current derivation. - `reportChanged()`: the atom has changed, and all derivations depending on it should be invalidated. Let’s wrap it a little so that it will be more convenient to use it in the future. ...