From 941e4c43a45589d304a93744ca76676c361a8e10 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Tue, 9 Jan 2024 22:59:45 -0500 Subject: [PATCH] Update recommendation for storage service When implementing your own storage service, it is usually preferred to return the `Promise` of the underlying API. This PR also adds other commonly used methods. --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1dd5bd3..a03efc5 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,15 @@ export class StorageService { // Create and expose methods that users of this service can // call, for example: public set(key: string, value: any) { - this._storage?.set(key, value); + return this._storage?.set(key, value); + } + + public get(key: string) { + return this._storage?.get(key); + } + + public remove(key: string) { + return this._storage?.remove(key); } } ```