react-native-onyx 3.0.145 → 3.0.147

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.
@@ -27,9 +27,9 @@ const applyMerge = (key, existingValue, validChanges) => {
27
27
  if (shouldSkipStorageOperations) {
28
28
  return Promise.resolve({ mergedValue });
29
29
  }
30
- // For native platforms we use `mergeItem` that will take advantage of JSON_PATCH and JSON_REPLACE SQL operations to
31
- // merge the object in a performant way.
32
- return storage_1.default.mergeItem(key, batchedChanges, replaceNullPatches).then(() => ({
30
+ // Delta writes retain nulls on insert and old fields after a whole-value reset.
31
+ const storagePromise = baseValue === undefined ? storage_1.default.setItem(key, mergedValue) : storage_1.default.mergeItem(key, batchedChanges, replaceNullPatches);
32
+ return storagePromise.then(() => ({
33
33
  mergedValue,
34
34
  }));
35
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "3.0.145",
3
+ "version": "3.0.147",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",