Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Galloway committed Aug 26, 2020
1 parent 9f12763 commit f020c63
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions test/use-swr.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,12 @@ describe('useSWR', () => {
}
function Initiator() {
const { isValidating, revalidate } = useBroadcast3()
const [shouldRevalidate, setShouldRevalidate] = useState(false)
useEffect(() => {
const timeout = setTimeout(() => {
setShouldRevalidate(true)
revalidate()
}, 200)
return () => clearTimeout(timeout)
}, [])
useEffect(() => {
if (shouldRevalidate) {
revalidate()
}
}, [shouldRevalidate])
return <>{isValidating ? 'true' : 'false'}</>
}
function Consumer() {
Expand Down

0 comments on commit f020c63

Please sign in to comment.