react-native-onyx 1.0.72 → 1.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md CHANGED
@@ -319,6 +319,7 @@ Initialize the store with actions and listening for storage events
319
319
  | [options.captureMetrics] | <code>Boolean</code> | | Enables Onyx benchmarking and exposes the get/print/reset functions |
320
320
  | [options.shouldSyncMultipleInstances] | <code>Boolean</code> | | Auto synchronize storage events between multiple instances of Onyx running in different tabs/windows. Defaults to true for platforms that support local storage (web/desktop) |
321
321
  | [options.debugSetState] | <code>Boolean</code> | | Enables debugging setState() calls to connected components. |
322
+ | [options.enableDevTools] | <code>Boolean</code> | | Enables debugging using Redux DevTools extension. |
322
323
 
323
324
  **Example**
324
325
  ```js
package/README.md CHANGED
@@ -321,8 +321,18 @@ Sample output of `Onyx.printMetrics()`
321
321
 
322
322
  # Debug mode
323
323
 
324
+ ## Using debugSetState
325
+
324
326
  It can be useful to log why Onyx is calling `setState()` on a particular React component so that we can understand which key changed, what changed about the value, and the connected component that ultimately rendered as a result. When used correctly this can help isolate problem areas and unnecessary renders in the code. To enable this feature, pass `debugSetState: true` to the config and grep JS console logs for `[Onyx-Debug]`.
325
327
 
328
+ ## Using Redux DevTools extension
329
+
330
+ It can be useful to check the order of writes to the storage and it's state at a specific point in time.
331
+
332
+ First, install Redux DevTools through your favorite browser ([Edge](https://microsoftedge.microsoft.com/addons/detail/redux-devtools/nnkgneoiohoecpdiaponcejilbhhikei), [Chrome](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/))
333
+
334
+ Then, you can enable this type of debugging by passing `enableDevTools: true` to `Onyx.init({...})`.
335
+
326
336
  # Development
327
337
 
328
338
  `react-native` bundles source using the `metro` bundler. `metro` does not follow symlinks, so we can't use `npm link` to