Closed nhunzaker closed 6 years ago
Merging #520 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #520 +/- ##
=======================================
Coverage 93.74% 93.74%
=======================================
Files 32 32
Lines 799 799
Branches 162 162
=======================================
Hits 749 749
Misses 43 43
Partials 7 7
Impacted Files | Coverage Δ | |
---|---|---|
packages/microcosm/src/microcosm.js | 88.57% <ø> (-0.32%) |
:arrow_down: |
packages/microcosm/src/history.js | 100% <100%> (ø) |
:arrow_up: |
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 609c6da...0d5f7fe. Read the comment docs.
What
This commit adds back the max history option to Microcosm, a feature of 12.x that controls how many actions Microcosm's history should hold on to.
This is based upon depth, not overall action count. This is so that you can checkout prior trees. For example:
This is with a size of 10, though in this case, the overall depth hasn't hit higher than 6. With a size of 3, this would look like:
This is zero by default in order to prevent memory leaks. However some apps (like email editors we have built in the past) may desire to hold on to a set number of actions for undo/redo and reporting features.
Why
I want to respect the 12.x API and keep this feature, which is extremely useful when you need it.