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
After some testing and using the existing implementation, I have found it to be inadequate and not very intuitive. Requiring more code to do something fairly simple, multiple loops at times.
Instead of an object or an array, it will simply be an object like so:
missed = {
keys: [
'key'
, 'key2'
]
, save: function(key, value) {
// Save value to appropriate key
}
}
This would allow usage like so:
db.find(missed.keys, function(err, values) {
if (err) return done(err)
for (var i = 0; i < values.length; i+=1) {
missed.save(values[i].key, values[i])
}
done()
}
I could even get rid of done, and have missed.done(), but I think having a clear done() function makes more sense in Node.js conventions.
The text was updated successfully, but these errors were encountered:
After some testing and using the existing implementation, I have found it to be inadequate and not very intuitive. Requiring more code to do something fairly simple, multiple loops at times.
Instead of an object or an array, it will simply be an object like so:
This would allow usage like so:
I could even get rid of done, and have
missed.done()
, but I think having a cleardone()
function makes more sense in Node.js conventions.The text was updated successfully, but these errors were encountered: