Closed markerikson closed 3 years ago
I think the only issue is if the object is really large, then the JSON.stringify
output would be as well. I don't know if there's a good workaround so we don't end up spamming the console log with a bunch of junk.
slice the string to a max of 100 characters or something? :)
I'm playing with inlining a cut-down version of https://github.com/jonschlinkert/kind-of in dev mode. That at least prints out 'Promise'
, 'Date'
, etc, instead of just 'object'
, and then it falls back to typeof
in prod.
Could still consider logging the actual values rather than the name of the type, if we think that would be beneficial.
The core
dispatch
function currently starts with:Frankly, I've always disliked the "async actions" term, which is part of why I avoided it completely in the new tutorials. The phrase seems confusing anyway.
On top of that, this doesn't actually tell you what was dispatched, which might be helpful for knowing what the actual problem is - is it a Promise, a function,
undefined
, or something else?We should reword this to drop the "async actions" phrase, and also have it log the received value.
I'm wondering if there's a good way to log the value itself. I know that over in React-Redux, we have a
stringifyComponent
function that tries to provide more details and falls back if it can't be stringified:maybe something like that would be relevant here?
This should be doable as a patch release for 4.x, so presumably 4.0.6.