Closed raulmatei closed 7 years ago
Hey Raul,
I've been travelling lately and haven't gotten a chance to address this. Should be a simple fix. I will do soon.
@raulmatei This should be fixed in 1.4.0
by the ability to pass in your own logger
@jordangarcia - I've seen the change log, but haven't had time to test. I think it should be fine to close this, as one could simply pass in a custom logger that handles the case presented in this issue.
Hi,
I was debugging a web app on an older Android device with the default browser, version 4.3 and found out that when I was dispatching without payload something fails. I started debugging deeper and I realized that the issue is in the logging module when calling
console.debug
with anundefined
payload. The error isTypeError: Cannot call method 'toString' of undefined
and is triggered by: https://github.com/optimizely/nuclear-js/blob/master/src/logging.js#L18Can we guard against this? I mean we can log something like 'No payload' or skip the logging if the payload is
undefined
/null
.Of course I can always send an empty object as a payload but I prefer
dispatch(ACTION_TYPE)
, because is shorter.Thanks, Raul.