Calling foo
two times creates two subscribers and that is not ok but even so the second call of foo
seems to get stuck somewhere because console.log
gets called only one time.
I know that I should not subscribe in this manner but I really do not see the solution to get myFunc
to output the second result
const myFunc = functions.httpsCallable('myFunc')
function foo(inData){
myFunc({data:inData}).subscribe((res)=>{
console.log(res)
})
}
foo('aaaaa')
foo('bbbbb')
second attempt still no luck
myFunc(data){
return functions.httpsCallable('myFunc')(data)
}
async function foo(inData){
let res = await lastValueFrom(myFunc({data:inData}))
console.log(res)
}
foo('aaaaa')
foo('bbbbb')