@@ -234,42 +234,24 @@ function _compare<T>(
234
234
// however: if the new remote order matches the current local order
235
235
// we can disregard the change notification generation so long as
236
236
// we are not configured to reset on remote update (which is deprecated)
237
- if ( DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE ) {
238
- if ( i < priorLocalLength ) {
239
- const priorLocalMember = priorLocalState ! [ i ] ;
240
- if ( remoteClearsLocal ) {
241
- if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
242
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
243
- ! changed && console . log ( `changed because member !== prevMember && remoteClearsLocal` ) ;
244
- }
245
- changed = true ;
246
- } else if ( priorLocalMember !== member ) {
247
- if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
248
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
249
- ! changed && console . log ( `changed because priorLocalMember !== member && member !== prevMember` ) ;
250
- }
251
- changed = true ;
252
- }
253
- }
254
- } else {
255
- if ( i < priorLocalLength ) {
256
- const priorLocalMember = priorLocalState ! [ i ] ;
257
- if ( priorLocalMember !== member ) {
258
- if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
259
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
260
- ! changed && console . log ( `changed because priorLocalMember !== member && member !== prevMember` ) ;
261
- }
262
- changed = true ;
263
- }
264
- } else if ( i < finalLength ) {
265
- // if we have exceeded the length of priorLocalState and we are within the range
266
- // of the finalState then we must have changed
237
+
238
+ if ( i < priorLocalLength ) {
239
+ const priorLocalMember = priorLocalState ! [ i ] ;
240
+ if ( priorLocalMember !== member ) {
267
241
if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
268
242
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
269
- ! changed && console . log ( `changed because priorMember !== member && index >= priorLocalLength ` ) ;
243
+ ! changed && console . log ( `changed because priorLocalMember !== member && member !== prevMember ` ) ;
270
244
}
271
245
changed = true ;
272
246
}
247
+ } else if ( i < finalLength ) {
248
+ // if we have exceeded the length of priorLocalState and we are within the range
249
+ // of the finalState then we must have changed
250
+ if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
251
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
252
+ ! changed && console . log ( `changed because priorMember !== member && index >= priorLocalLength` ) ;
253
+ }
254
+ changed = true ;
273
255
}
274
256
275
257
// if remote order hasn't changed but local order differs
@@ -280,6 +262,10 @@ function _compare<T>(
280
262
if ( equalLength && ! changed && i < priorLocalLength ) {
281
263
const priorLocalMember = priorLocalState ! [ i ] ;
282
264
if ( priorLocalMember !== prevMember ) {
265
+ if ( DEBUG_RELATIONSHIP_NOTIFICATIONS ) {
266
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
267
+ ! changed && console . log ( `changed because priorLocalMember !== prevMember && remoteClearsLocal` ) ;
268
+ }
283
269
changed = true ;
284
270
}
285
271
}
0 commit comments