Closed hypesystem closed 8 years ago
I think message_id would be fine. In case of success. In case of failure probably just a message
@hypesystem maybe rename the result
callback param in sender.send(msg, ids, function(error, result)
to:
info
response
status
Or, maybe we can rename the internal results
object to messages
? Or devices
? But we'd want to provide backward-compatibility.
I like response
:smile:
@hypesystem Sounds good -- so the modification should only be in the documentation, correct? And any tests as well.
Yes, that is correct.
This may look like a small issue, but suggesting code like this causes problems with readability:
Why? Well, if we want to iterate over the internal results, we get this:
You may suggest simply changing the inner variable in the
forEach
to something else, but that won't change the fact that the most obvious name for an entry in a list calledresults
isresult
.What we can change, however, is the suggested name of the
result
-object returned from ´Sender#send`.Alternatively, the result could be wrapped in some abstraction that would make it more accessible.