Update storage promise

A new doStore was added.
This commit is contained in:
Asher
2021-02-09 10:36:39 -06:00
parent 14c96d78ef
commit 89c38d3554
5 changed files with 10 additions and 28 deletions

View File

@@ -118,13 +118,8 @@ export class BrowserStorageService extends AbstractStorageService {
return this.getStorage(scope).getNumber(key, fallbackValue);
}
<<<<<<< HEAD
store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {
protected doStore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {
return this.getStorage(scope).set(key, value);
=======
protected doStore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): void {
this.getStorage(scope).set(key, value);
>>>>>>> e4a830e9b7ca039c7c70697786d29f5b6679d775
}
protected doRemove(key: string, scope: StorageScope): void {

View File

@@ -104,11 +104,7 @@ export interface IStorageService {
* @param target allows to define the target of the storage operation
* to either the current machine or user.
*/
<<<<<<< HEAD
store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> | void;
=======
store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope, target: StorageTarget): void;
>>>>>>> e4a830e9b7ca039c7c70697786d29f5b6679d775
store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope, target: StorageTarget): Promise<void> | void;
/**
* Delete an element stored under the provided key from storage.
@@ -402,7 +398,7 @@ export abstract class AbstractStorageService extends Disposable implements IStor
abstract getNumber(key: string, scope: StorageScope, fallbackValue: number): number;
abstract getNumber(key: string, scope: StorageScope, fallbackValue?: number): number | undefined;
protected abstract doStore(key: string, value: string | boolean | number, scope: StorageScope): void;
protected abstract doStore(key: string, value: string | boolean | number, scope: StorageScope): Promise<void> | void;
protected abstract doRemove(key: string, scope: StorageScope): void;

View File

@@ -188,13 +188,8 @@ export class NativeStorageService extends AbstractStorageService {
return this.getStorage(scope).getNumber(key, fallbackValue);
}
<<<<<<< HEAD
store(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {
protected doStore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {
return this.getStorage(scope).set(key, value);
=======
protected doStore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): void {
this.getStorage(scope).set(key, value);
>>>>>>> e4a830e9b7ca039c7c70697786d29f5b6679d775
}
protected doRemove(key: string, scope: StorageScope): void {