reactjs - Execute async task in componentWillUnmount in React Native? -


i trying disconnect bluetooth device before unmounting component in react native. disconnect done asynchronously. following approach not disconnecting device. how can make work?

i guess has fact disconnect done async.

componentwillunmount(){    bluetoothmanager.disconnect(device); // working in other contexts. } 


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -