Open Raynos opened 11 years ago
One thing I plan to implement is introspect
function that I believe will improve debugging story. I also hope browsers will get better at this. I know Anton already started implementing it for Firefox.
https://bugzilla.mozilla.org/show_bug.cgi?id=834506 https://code.google.com/p/chromium/issues/detail?id=172127&thanks=172127&ts=1359073198
If you have any specific ideas I'm more than happy to explore.
@Gozala there is a difference between debugging by printing and debugging by stepping through
Currently the way reducers/reducible works is that stepping through means you step through all these wrappers and proxies and never get to any meat. Stepping through is really hard to follow
introspect won't be for printing it will let you stop throughput in specific scenarios and then tweak / pause / resume values send.
@Gozala oh interesting. Show an example of it.
var debugee = introspect(input, {
next: function(value, result) {
if (isMyCase(vaue, result)) {
pause(debugee)
console.log("Oops condition")
}
},
end: function() {
debugger;
},
error: function() {
debugger;
}
})
pause(debugee) // will buffer all values until resumed.
// you can tweak buffer
debugee.buffer.unshift("my thingy")
resume(debugee)
Try stepping through code that uses reducers with a debugger. It's almost impossible to make any sense of it.
Is there something we can do to rejig the implementation that makes it easier to debug