Skip to content

Commit

Permalink
fix: flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
drewatk committed Jul 31, 2024
1 parent 62a5c7f commit 8f8eb58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/relay-runtime/store/RelayReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,9 @@ function getResolverValue(
let resolverResult = null;
let resolverError = null;

const shouldPassContextToLiveResolver =
liveResolverContext && field.kind === 'RelayLiveResolver';
const shouldPassContextToLiveResolver = !!(
liveResolverContext && field.kind === 'RelayLiveResolver'
);
try {
const resolverFunctionArgs = [];
if (field.fragment != null) {
Expand Down
4 changes: 2 additions & 2 deletions packages/relay-runtime/store/RelayStoreSubscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class RelayStoreSubscriptions implements StoreSubscriptions {
source,
snapshot.selector,
this._resolverCache,
this._liveResolverContext,
this._liveResolverContext || undefined,
);
const nextData = recycleNodesInto(snapshot.data, backup.data);
(backup: $FlowFixMe).data = nextData; // backup owns the snapshot and can safely mutate
Expand Down Expand Up @@ -176,7 +176,7 @@ class RelayStoreSubscriptions implements StoreSubscriptions {
source,
snapshot.selector,
this._resolverCache,
this._liveResolverContext,
this._liveResolverContext || undefined,
)
: backup;
const nextData = recycleNodesInto(snapshot.data, nextSnapshot.data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class LiveResolverStore implements Store {
source,
selector,
this._resolverCache,
this._liveResolverContext,
this._liveResolverContext || undefined,
);
if (__DEV__) {
deepFreeze(snapshot);
Expand Down

0 comments on commit 8f8eb58

Please sign in to comment.