Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Get back the oldData in case the query errored (#98)
Browse files Browse the repository at this point in the history
It will be empty anyway on the first fetch. But on a force refetch or
polling, it won't empty the component from its data while still adding
the errors. to it.

Fixes #97
  • Loading branch information
rricard authored and James Baxley committed Jul 11, 2016
1 parent 311ef4f commit dbb03dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export default function connect(opts?: ConnectOptions) {
};

let oldData = {};
const forceRender = ({ errors, data = {} }: any) => {
const forceRender = ({ errors, data = oldData }: any) => {
const resultKeyConflict: boolean = (
'errors' in data ||
'loading' in data ||
Expand Down

0 comments on commit dbb03dd

Please sign in to comment.