right now, i'm writing some promise code that looks like this. i need to both store the unsubscribe function returned from the subcribtion, as well as wait for the subscriber callback to run once before proceeding, and it looks pretty ugly:
let chatLoaded = false; // don't start loading messages until chat info has loaded
await new Promise(resolve =>
unsubs.push(
chatRef.onSnapshot(
doc => {
uiStore.receiveChat(doc.data());