Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
XiNiHa committed Dec 11, 2024
1 parent 67bb5ef commit a115924
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/relay-runtime/store/observeFragmentExperimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function observePluralSelector<
);

return Observable.create(sink => {
// This array is mutable since each subscription updates the array in place.
const states = snapshots.map((snapshot, index) =>
snapshotToFragmentState(
environment,
Expand All @@ -202,6 +203,8 @@ function observePluralSelector<
fragmentSelector.selectors[index].owner,
latestSnapshot,
);
// This doesn't batch updates, so it will notify the subscriber multiple times
// if a store update impacting multiple items in the list is published.
sink.next((mergeFragmentStates(states): $FlowFixMe));
}),
);
Expand Down

0 comments on commit a115924

Please sign in to comment.