Not sure if this is a stupid question but is there a cleaner looking way to only utilise the second/third callback when a function is called?
uploadTask.on('state_change', ()=>{}, ()=> {}, () => {
updateCampsite(newCampsiteRef.id, data)
})
Here I only want to use the third call back but it won't work without the empty functions before it. Is there a better way? Or should I not do this at all?
TIA!
Pass undefined instead of the empty functions. However, if that gives any error, then pass empty functions. It would be alright even then also.
uploadTask.on('state_change', undefined, undefined, () => {
updateCampsite(newCampsiteRef.id, data)
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With