I need a way to add extra parameters to callback method that should have a specific signature given by some service's API documentation.
For example, the callback should have one parameter of type string but I want to add an extra int to the parameters.
The only trick I thought of is abusing the "bind" like this:
var callbackFunc = originalCallback.bind({extraParam: myInt}, theNeededString)
And inside the callback I can get the int like this: this.extraParam
Do you have other tips or tricks?