You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing in bad values to .set or .put, sometimes the callbacks are invoked, and sometimes they aren't. For example:
Gun().get('test').set(NaN,function(){console.log(arguments)})// the function is never called
But if you pass in Infinity instead, the callback will fire, passing in an error object with the message "Invalid value at [soul]!". But it doesn't stop there! There's even inconsistency between .set and .put (even though .set uses .put under the hood).
Gun().get('test').path('callback madness').set(Infinity,callback)// invoked, error given. Let's try put this time...Gun().get('test').path('callback madness').put(Infinity,callback)// not invoked, no error! What?
These errors might be the last string of sanity that beginners have, since gun doesn't throw traditional errors.
The text was updated successfully, but these errors were encountered:
When passing in bad values to
.set
or.put
, sometimes the callbacks are invoked, and sometimes they aren't. For example:But if you pass in Infinity instead, the callback will fire, passing in an error object with the message
"Invalid value at [soul]!"
. But it doesn't stop there! There's even inconsistency between.set
and.put
(even though.set
uses.put
under the hood).These errors might be the last string of sanity that beginners have, since gun doesn't throw traditional errors.
The text was updated successfully, but these errors were encountered: