-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(FetchyeProvider): correct stale data bug (#47)
Ensure the selector properly causes a render when the key changes
- Loading branch information
1 parent
574ccd3
commit 2ff8c5a
Showing
3 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/fetchye/__tests__/__snapshots__/FetchyeProvider.spec.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`FetchyeProvider should return a stable response from useFetchyeSelector that changes properly with a changed input 1`] = ` | ||
[MockFunction] { | ||
"calls": Array [ | ||
Array [ | ||
Object { | ||
"data": "val1", | ||
"error": undefined, | ||
"loading": false, | ||
}, | ||
], | ||
Array [ | ||
Object { | ||
"data": "val1", | ||
"error": undefined, | ||
"loading": false, | ||
}, | ||
], | ||
Array [ | ||
Object { | ||
"data": "val2", | ||
"error": undefined, | ||
"loading": false, | ||
}, | ||
], | ||
], | ||
"results": Array [ | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters