-
Notifications
You must be signed in to change notification settings - Fork 1.3k
enhance: move online listeners to config (#474) #476
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the extra RECONNECT_REVALIDATORS
🤔. Can we use the same FOCUS_REVALIDATORS
(and rename it to just REVALIDATORS
?
we still have |
oops, looks like if we still have to separate reconnect and focus revalidators? when you disable |
@@ -5,7 +5,7 @@ export default (req, res) => { | |||
res.json({ | |||
loggedIn: true, | |||
name: 'Shu', | |||
avatar: 'https://github.com/quietshu.png' | |||
avatar: 'https://github.com/shuding.png' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🤣
src/use-swr.ts
Outdated
CACHE_REVALIDATORS[key].push(onUpdate) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move https://github.com/vercel/swr/pull/476/files#diff-ab20307c185620c9b54994fa4dcee1b7R512-R513 here and change https://github.com/vercel/swr/pull/476/files#diff-ab20307c185620c9b54994fa4dcee1b7R556-R560 to
addRevalidator(CACHE_REVALIDATORS, onUpdate)
Changes
Resolves #474 , attach online event listeners in config
Test Plan