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
Would it be possible to add a check to in the subscribe function that func is actually a function. Currently if func is undefined or not a function the error only occurs when the message is published
PubSub.subscribe=function(message,func)
Or do you think this is necessary/unlikely that is it not worth checking?
Many thanks
.
The text was updated successfully, but these errors were encountered:
Fail silently
If there is no function passed to subscribe, then we return false, and do nothing more.
Create exception
If there is no function passed to subscribe, then we throw an exception and do nothing more
While I would prefer option 2, I think that option 1 is a smaller change from current behaviour, so for the sake of easy upgrades, that should probably be the option for now.
Perhaps in v2.x we can throw exceptions when users of the library are doing silly things
Would it be possible to add a check to in the subscribe function that func is actually a function. Currently if func is undefined or not a function the error only occurs when the message is published
Or do you think this is necessary/unlikely that is it not worth checking?
Many thanks
.
The text was updated successfully, but these errors were encountered: