I am using WatermelonDB in my RN app. I am trying to display a button if WatermelonDB has unsynced changes. WatermelonDB has a function called hasUnsyncedChanges that returns a boolean. I can get the function to console.log true/false. But unsure how to use this outside of the async function.
async function checkUnsyncedChanges() {
return await hasUnsyncedChanges({database});
}
(async () => {
console.log(await checkUnsyncedChanges());})();
I am new to React Native and have had good luck researching other issues with WatermelonDB but running into a wall in how to get this working.