react-native-onyx
react-native-onyx copied to clipboard
Persistent, offline-first state management solution for React Native. Easy to use with minimal config and boilerplate.
### Details This PR does the following changes: - Changes `useOnyx` to return `undefined` instead of `null`, [thus allowing us to use default values more easily](https://github.com/Expensify/App/issues/34339#issuecomment-2057486233). - Changes `OnyxEntry` and...
### Details This PR changes how we process the `Onyx.update` operation: 1. Enqueue all the operations per individual key; 2. Group the collection-related keys into a single `mergeCollection` call; 3....
### Details This PR migrates `withOnyx.js` to TypeScript. ### Related Issues https://github.com/Expensify/App/issues/34343 ### Automated Tests N/A ### Manual Tests TODO ### Author Checklist - [ ] I linked the correct...
`mergeCollection`: individual collection item subscriber is called even if the value did not change
When executing `mergeCollection`, Onyx calls the collection subscriber callback and all the collection items subscribers callbacks, even if those items did not change. As a result, if there is a...
As described in [this P/S proposal](https://expensify.slack.com/archives/C01GTK53T8Q/p1712647832633819) i want to create mock implementations directly in `react-native-quick-sqlite` and `idb-keyval`, which we can then use to improve and add new (unit) tests in...
@tgolen (no need to add comments yet) ### Details Based on the ideas and notes in https://github.com/Expensify/react-native-onyx/pull/526 ### Related Issues GH_LINK ### Automated Tests ### Manual Tests ### Author Checklist...
### Details ### Related Issues GH_LINK ### Automated Tests ### Manual Tests ### Author Checklist - [ ] I linked the correct issue in the `### Related Issues` section above...
### Details Following proposal: https://github.com/Expensify/App/issues/35809 ### Related Issues ### Manual Tests https://github.com/Expensify/App/pull/36226#issuecomment-1938661752 ### Author Checklist - [X] I linked the correct issue in the `### Related Issues` section above -...
There are 2 ways to merge a specific item that belongs to a collection: - Calling `Onyx.merge()` directly; - Calling `Onyx.mergeCollection()` for the collection holding this item. These 2 operations...
_I've put up a draft PR with a unit test to cover this issue, and a potential fix: https://github.com/Expensify/react-native-onyx/pull/515_ **Test case:** 1. Setup the initial value: ```js const initialValue =...