flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.
MIT License
3k stars 214 forks source link

Remove second argument of applyChange from public api #115

Closed fedulovivan closed 6 years ago

fedulovivan commented 7 years ago

https://github.com/flitbit/diff/blob/c97fb9ce8840283c78f1d70b6420d11291435e82/index.js#L260

Hello! First of all thanks for a nice tool.

Is it possible to completely remove second argument 'source' from public api of applyChange utility? Even it is not really used (and docs clearly state this), function checks that passed source is 'truthy', so a have to use following pattern:

changes.forEach(change => applyChange(
    INITIAL_STATE,
    true/*stated as not used in docs, but have to be truthy to pass internal checks*/, 
    change
))
flitbit commented 6 years ago

My bad, got distracted and never released v1.0.0... doing that now.