[Typescript]: Event listeners type signature issue after 2.0.3 release
gadishimwe opened this issue · 3 comments
gadishimwe commented
Hello. When 2.0.3 was released, the listener functions type signature was changed from Function
to () => void
.
With the new signature, it means that these functions will not receive any arguments. You can see this change here:
Now my question is, how are we going to get those values that we were expecting for those events?
For example:
OneSignal.on('subscriptionChange', function(isSubscribed) {
console.log("The user's subscription state is now:", isSubscribed);
});
This code can't be compiled by typescript. Thanks
rgomezp commented
Howdy,
Thanks for opening the issue. This is indeed a problem. Thanks for your patience while we resolve.
gadishimwe commented
Howdy, Thanks for opening the issue. This is indeed a problem. Thanks for your patience while we resolve.
Howdy. You're welcome!
rgomezp commented
@gadishimwe , this is now fixed in 2.0.4.
Enjoy!