Skip to content
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

fix(cleanup): remove scheduler code from flush-microtasks #744

Merged
merged 4 commits into from
Jul 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__tests__/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('cleanup waits for queued microtasks during unmount sequence', async () =>
const spy = jest.fn()

const Test = () => {
React.useEffect(() => () => setImmediate(spy))
React.useEffect(() => () => setTimeout(spy, 200))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users can do all kinds of async things as a result of their cleanup functions and it's not reasonable for them to expect that we'll wait until all those async things are done. They'll have to wait for those things themselves.

So we shouldn't have a setImmediate in here at all.


return null
}
Expand Down