diff --git a/packages/react-urql/src/hooks/state.ts b/packages/react-urql/src/hooks/state.ts index 5b125fc10a..9ecb0bd924 100644 --- a/packages/react-urql/src/hooks/state.ts +++ b/packages/react-urql/src/hooks/state.ts @@ -4,11 +4,11 @@ export const initialState = { error: undefined, data: undefined, extensions: undefined, - operation: undefined + operation: undefined, }; const isShallowDifferent = (a: any, b: any) => { - if (typeof a != "object" || typeof b != "object") return a !== b; + if (typeof a != 'object' || typeof b != 'object') return a !== b; for (const x in a) if (!(x in b)) return true; for (const x in b) if (a[x] !== b[x]) return true; return false; @@ -31,7 +31,7 @@ export const computeNextState = ( data: result.data !== undefined || result.error ? result.data : prevState.data, fetching: !!result.fetching, - stale: !!result.stale + stale: !!result.stale, }; return isShallowDifferent(prevState, newState) ? newState : prevState;