private async removeItem(key = 'foo'): Promise<void> {
await this.storage.remove(key);
}
then later:
private async getItems(key = 'foo'): Promise< string[] | null> {
return await this.storage.get(key);
}
the return value is a partial array of what was previously in foo. I have to call remove()
twice for it to be completely removed…
for example:
private async removeItem(key = 'foo'): Promise<void> {
await this.storage.remove(key);
await this.storage.remove(key);
}
only then will all items be deleted.