relay-runtime 0.0.0-main-9ee9d8d0 → 0.0.0-main-6e8b52f6
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/index.js +1 -1
- package/lib/store/RelayModernSelector.js +16 -2
- package/package.json +1 -1
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/RelayModernSelector.js.flow +32 -8
package/index.js
CHANGED
|
@@ -284,6 +284,10 @@ function getVariablesFromPluralFragment(fragment, items) {
|
|
|
284
284
|
});
|
|
285
285
|
return variables;
|
|
286
286
|
}
|
|
287
|
+
|
|
288
|
+
function areEqualSingularSelectors(thisSelector, thatSelector) {
|
|
289
|
+
return thisSelector.owner === thatSelector.owner && thisSelector.dataID === thatSelector.dataID && thisSelector.node === thatSelector.node && areEqual(thisSelector.variables, thatSelector.variables);
|
|
290
|
+
}
|
|
287
291
|
/**
|
|
288
292
|
* @public
|
|
289
293
|
*
|
|
@@ -293,8 +297,18 @@ function getVariablesFromPluralFragment(fragment, items) {
|
|
|
293
297
|
*/
|
|
294
298
|
|
|
295
299
|
|
|
296
|
-
function areEqualSelectors(
|
|
297
|
-
|
|
300
|
+
function areEqualSelectors(a, b) {
|
|
301
|
+
if ((a === null || a === void 0 ? void 0 : a.kind) === 'SingularReaderSelector' && (b === null || b === void 0 ? void 0 : b.kind) === 'SingularReaderSelector') {
|
|
302
|
+
return areEqualSingularSelectors(a, b);
|
|
303
|
+
} else if ((a === null || a === void 0 ? void 0 : a.kind) === 'PluralReaderSelector' && (b === null || b === void 0 ? void 0 : b.kind) === 'PluralReaderSelector') {
|
|
304
|
+
return a.selectors.length === b.selectors.length && a.selectors.every(function (s, i) {
|
|
305
|
+
return areEqualSingularSelectors(s, b.selectors[i]);
|
|
306
|
+
});
|
|
307
|
+
} else if (a == null && b == null) {
|
|
308
|
+
return true;
|
|
309
|
+
} else {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
298
312
|
}
|
|
299
313
|
|
|
300
314
|
function createReaderSelector(fragment, dataID, variables, request) {
|