I have a function, that is returning callback. But meetUid is static on here.
fetchMeetDetails = async (callback) => {
const meetUid = '1a712f91-974d-4185-9389-f7b1b4edede2';
const snapshot = await database().ref(`/meets/${meetUid}`).once('value');
callback(snapshot.val())
}
I want to get meetUid from parameters. like that fetchMeetDetails = async (callback,meetUid) => { but I cannot do it. Because we got an error (TypeError : callback is not a function). How can I use this function with callback and parameters ?
asyncfunction? Justreturnthe result.fetchMeetDetails.callbackas a parameter is unclear thus the compiler complains. Try this(callback=f=>f, meetUid)fetchMeetDetailsfunction? You need to pass a javascript function tofetchMeetDetailsin order to execute something likecallback(foo).Callbackis just a name convention for javascript function which will be excuted after an async action returns a result (success or error)