ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
601 stars 154 forks source link

returns subscriptions on addEventListener #135

Closed felipecespedes closed 4 years ago

felipecespedes commented 4 years ago

returns subscription when calling the addEventListener() method then we can call the remove() method to unsubscribe

const subscription = Tts.addEventListener(type, handler);

// Then to unsubscribe
subscription.remove();