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

Extended diff option to allow for a custom differ function #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vdh
Copy link
Contributor

@vdh vdh commented Jun 9, 2017

I use Immutable.js alongside an Immutable.js Object Formatter Chrome Extension, and it would be great to be able to use a custom differ instead of needing to convert everything via the stateTransformer option.

@codecov-io
Copy link

codecov-io commented Jun 9, 2017

Codecov Report

Merging #241 into master will increase coverage by 0.22%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
+ Coverage   83.56%   83.78%   +0.22%     
==========================================
  Files           5        5              
  Lines         146      148       +2     
==========================================
+ Hits          122      124       +2     
  Misses         24       24
Impacted Files Coverage Δ
src/diff.js 100% <100%> (ø) ⬆️
src/core.js 76.38% <50%> (+0.33%) ⬆️

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 38d48a0...b1f3281. Read the comment docs.

src/diff.js Outdated
export default function diffLogger(prevState, newState, logger, isCollapsed) {
const diff = differ(prevState, newState);
export default function diffLogger(prevState, newState, logger, isCollapsed, customDiffer) {
const diff = (customDiffer || differ)(prevState, newState);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could use default paremeters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thiamsantos Yeah that makes sense -> b1f3281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants