Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-08-02 16:04:41 +03:00
parent e4724708eb
commit b77bfb03ee

13
diff.js
View File

@ -996,12 +996,19 @@ module.Types = {
// XXX make this an extensible walker... // XXX make this an extensible walker...
// ...ideally passed a func(A, B, obj, handle(action, value)) where: // ...ideally passed a func(A, B, obj, ...) where:
// A - change.A // A - change.A
// B - change.B // B - change.B
// obj - object at change.path // obj - object at change.path
// action - action to perform ('replace', 'return', ...) // func(..) should be able to:
// value - action argument... // - replace obj with B (patch)
// ...current implementation of .patch(..)
// - check obj against B (check)
// - swap A and B (reverse) ???
// - ...
// one way to do this is to pass func(..) a handler that it
// would call to control the outcome...
// ...still needs thought, but this feels right...
_walk: function(diff, obj, options){ _walk: function(diff, obj, options){
var that = this var that = this
var NONE = diff.placeholders.NONE var NONE = diff.placeholders.NONE