ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
618 stars 156 forks source link

fixes addEventListener TS declaration to return RN.EmitterSubscription #204

Closed mikemikhaylov closed 2 years ago

mikemikhaylov commented 2 years ago

Actual implementation of Tts class has method

addEventListener(type, handler) {
    return this.addListener(type, handler);
  }

which returns EmitterSubscription And the typescript declaration currently does not. Added it to be able to call remove() on it, since NativeEventEmitter.removeListener is now deprecated https://github.com/facebook/react-native/blob/main/Libraries/EventEmitter/NativeEventEmitter.js#L99

mikemikhaylov commented 2 years ago

Hey @ak1394 just friendly reminder

ak1394 commented 2 years ago

Thanks!