Update storageService implementations (#1033)
* Add htmlStorageService.has * Add memoryStorageService.has
This commit is contained in:
parent
7c64c812fc
commit
44bf90cf6a
|
@ -44,6 +44,10 @@ export class HtmlStorageService implements StorageService {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async has(key: string): Promise<boolean> {
|
||||||
|
return this.get(key) != null;
|
||||||
|
}
|
||||||
|
|
||||||
save(key: string, obj: any): Promise<any> {
|
save(key: string, obj: any): Promise<any> {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return this.remove(key);
|
return this.remove(key);
|
||||||
|
|
|
@ -11,6 +11,10 @@ export class MemoryStorageService implements StorageService {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async has(key: string): Promise<boolean> {
|
||||||
|
return this.get(key) != null;
|
||||||
|
}
|
||||||
|
|
||||||
save(key: string, obj: any): Promise<any> {
|
save(key: string, obj: any): Promise<any> {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return this.remove(key);
|
return this.remove(key);
|
||||||
|
|
Loading…
Reference in New Issue