as the title says I want to extract the variable status to be able to use it in another part of the code, is this possible?
RNAudioStreamer.status((err, status)=>{if(!err) console.log(status)})
as the title says I want to extract the variable status to be able to use it in another part of the code, is this possible?
RNAudioStreamer.status((err, status)=>{if(!err) console.log(status)})
Depending on the callback sync/async you can create a global variable or use promise.
let p = new Promise((resolve, reject) => {
RNAudioStreamer.status((err, status)=>{
if(!err) resolve(status); else reject(err);
})
});
// ...
p.then(status => {
// process status here
})