Hi,
I have values stored with capacitor storage and retrieve them with the following code:
export async function getStorage(key: string): Promise<any> {
const item = await Plugins.Storage.get({ key });
return JSON.parse(item.value);
}
and then I have a method:
async getretrievedValue() {
this.retrievedValue = await getStorage("retrievedValue");
console.log(this.retrievedValue);
}
so this all works, but how do I set this as an Observable so that it will be available throughout the app and also automatically updates when the value changes?
Thank you for your help
3 posts - 2 participants