feat(data): add method that checks if data item has been saved

This commit is contained in:
Jovan Krunić
2019-02-12 14:06:54 +01:00
parent 7caaa18b7e
commit 017fc67765
2 changed files with 15 additions and 0 deletions

View File

@@ -147,4 +147,13 @@ export class DataProvider {
async search(query: SCSearchQuery): Promise<SCSearchResponse> {
return (await this.client.search(query));
}
/**
* Provides information if something with an UID is saved as a data item
*
* @param uid Unique identifier of the saved data item
*/
async isSaved(uid: string): Promise<boolean> {
return this.storageProvider.has(this.getDataKey(uid));
}
}