-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Fix dependency tracking and useSES bug #2576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd32d6c
fix #2446
shuding 4a435f6
test: update `compare` test snapshot
promer94 38adbea
test: adjust compare order, makes the snapshot easier to understand
promer94 f3a30c6
add test case
shuding 00fdf51
refactor: update `memorizedSanpshot` without changing its reference …
promer94 2d15042
revert example change
shuding 9cf2713
add comment
shuding File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,21 +1,49 @@ | ||
import Link from 'next/link' | ||
import fetch from '../libs/fetch' | ||
// import Link from 'next/link' | ||
shuding marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// import fetch from '../libs/fetch' | ||
|
||
// import useSWR from 'swr' | ||
|
||
// export default function Index() { | ||
// const { data } = useSWR('/api/data', fetch) | ||
|
||
// return ( | ||
// <div style={{ textAlign: 'center' }}> | ||
// <h1>Trending Projects</h1> | ||
// <div> | ||
// { | ||
// data ? data.map(project => | ||
// <p key={project}><Link href='/[user]/[repo]' as={`/${project}`}>{project}</Link></p> | ||
// ) : 'loading...' | ||
// } | ||
// </div> | ||
// </div> | ||
// ) | ||
// } | ||
|
||
import useSWR from 'swr' | ||
import React, { useState, useEffect } from 'react' | ||
|
||
const sleep = ms => | ||
new Promise(resolve => { | ||
setTimeout(() => resolve('foo'), ms) | ||
}) | ||
|
||
export default function App() { | ||
const [state, setState] = useState(false) | ||
useEffect(() => { | ||
let timeout = setTimeout(() => { | ||
setState(true) | ||
}, 2000) | ||
return () => { | ||
clearTimeout(timeout) | ||
} | ||
}, []) | ||
|
||
const joke = useSWR('joke', () => sleep(1000)) | ||
|
||
if (!state || !joke.data) { | ||
return <div>loading</div> | ||
} | ||
|
||
export default function Index() { | ||
const { data } = useSWR('/api/data', fetch) | ||
|
||
return ( | ||
<div style={{ textAlign: 'center' }}> | ||
<h1>Trending Projects</h1> | ||
<div> | ||
{ | ||
data ? data.map(project => | ||
<p key={project}><Link href='/[user]/[repo]' as={`/${project}`}>{project}</Link></p> | ||
) : 'loading...' | ||
} | ||
</div> | ||
</div> | ||
) | ||
return <div>{joke.data}</div> | ||
} |
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.