diff --git a/lib/Onyx.js b/lib/Onyx.js index 6b662d5f..1e69e44a 100644 --- a/lib/Onyx.js +++ b/lib/Onyx.js @@ -527,6 +527,11 @@ function evictStorageAndRetry(error, ionMethod, ...args) { * @returns {Promise} */ function set(key, val) { + // Skip writing to storage if the value hasn't changed + if (cache.hasCacheForKey(key) && _.isEqual(val, cache.getValue(key))) { + return Promise.resolve(); + } + // Adds the key to cache when it's not available cache.set(key, val);