FormidableLabs / redux-little-router

A tiny router for Redux that lets the URL do the talking.
MIT License
1.04k stars 114 forks source link

Refactor enhancer store subscriber and history listener #242

Closed aweary closed 6 years ago

aweary commented 6 years ago

I had some trouble testing changes made to one of these callbacks in https://github.com/FormidableLabs/redux-little-router/pull/240, so here's a small refactor that makes them a bit more testable. This PR:

I'm not sure it's the best solution but it seems sufficient to me 🤷‍♂️

codecov[bot] commented 6 years ago

Codecov Report

Merging #242 into master will increase coverage by 0.42%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #242      +/-   ##
==========================================
+ Coverage   98.44%   98.87%   +0.42%     
==========================================
  Files          19       19              
  Lines         258      266       +8     
==========================================
+ Hits          254      263       +9     
+ Misses          4        3       -1
Impacted Files Coverage Δ
src/enhancer.js 100% <100%> (+5.55%) :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 207222c...5c2817b. Read the comment docs.