Debugging
For debugging, we recommend using the @reatom/logger
package, which is included in the @reatom/framework
. It logs all you actions and atoms changes in the console if you named it properly.
Installation
#After the installation is finished, you need to connect the logger to the reatom context.
Usage
#The immutable nature of reatom gives us incredible possibilities for debugging any data flow, whether synchronous or asynchronous. Let’s start with a simple example.
Here is what we see in logs:
Records come in pairs: the atom and its new state value. Under the atom name record, you can find a few properties:
- cause: Describes why this update happened and what triggered it.
- history: Shows the atom values before the update.
Check out the @reatom/logger package documentation for available options.
Try to use @reatom/eslint-plugin to automate the names indication.