Skip to content

feat: add (experimental) flushEffects to prepare for hooks #223

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
merged 1 commit into from
Nov 21, 2018

Conversation

kentcdodds
Copy link
Member

What: add (experimental) flushEffects API

Why: to prepare for hooks

The more that I've thought it over, the more I'm thinking it may actually be better to force people to flush effects intentionally (even if it is a little less ergonomic). In any case, I think it's not a bad thing to have.

How:

When ReactDOM.render is called, all in-flight effects are run synchronously (at least with the current implementation of hooks). If that ever changes, we can update the flushEffects implementation, but this allows people to test their hooks as they experiment with the new hooks API.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table N/A

@codecov
Copy link

codecov bot commented Nov 21, 2018

Codecov Report

Merging #223 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #223   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          24     25    +1     
  Branches        4      4           
=====================================
+ Hits           24     25    +1
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 169434f...178bb6a. Read the comment docs.

@kentcdodds kentcdodds merged commit 11a41ce into master Nov 21, 2018
@kentcdodds kentcdodds deleted the pr/flush-effects branch November 21, 2018 04:44
@kentcdodds
Copy link
Member Author

🎉 This PR is included in version 5.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

lucbpz pushed a commit to lucbpz/react-testing-library that referenced this pull request Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant