edusperoni/nativescript-mqtt

Typescript error for Message (onMessageArrived)

Closed this issue · 3 comments

I followed the angular template using vue-template-ts and I got this error

image

Since message can be undefined, you can use .on((message?: Message) => {

Can I little help with TS? :),
image
It says Object is possibly undefined

you can use:

if (message) {
// do stuff with message
}