I'm using firestore to create records
const add = db.collection("people").add({name: "test"})
this returns a promise and then I do something like
add.then(person => console.log(person))
I need to convert that promise to a synchronous function because I can´t use then() to trigger a link. (looks like a browser limitation for this particular use case)
if (add(...) {
console.log("would like to use the person here but since is not a promise I don´t know how")
}
const add = (data) => {
return data
}
const result = add(1);
if (result) {
console.log(result)
} else {
console.log("no result")
}