Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for callback prior to firing it
Prevents an error when client is used without a callback.
- Loading branch information
fbca445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use-case for it? In my opinion it makes no sense to use it without the callback
fbca445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes the API more resilient to developer errors. Also many times you want to make a request without caring about the response. For example, health checks, pingbacks, push requests to services (I was doing a data push to Geckoboard when encountering this).
fbca445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it also hide errors - if I forget to pass a callback in, I want the app to break, not to hide it. Also, if you are about to make healtchecks, pingbacks, you need the callback, that's the only way to check for status codes/errors
fbca445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.