Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support asynchronous methods in ICacheStore #114

Open
therealsujitk opened this issue Jun 15, 2024 · 0 comments
Open

Support asynchronous methods in ICacheStore #114

therealsujitk opened this issue Jun 15, 2024 · 0 comments

Comments

@therealsujitk
Copy link

therealsujitk commented Jun 15, 2024

I'd like to use this package on the server side that doesn't support localStorage, so I'm using a custom cache API to store the access token and other constants required by this package. It's very cool that this package already supports writing your own cache implementation, however the current implementation doesn't support asynchronous methods. Here's an example of what I want to accomplish.

class CustomCachingStore implements ICacheStore {
  private readonly customCache = new CustomCache();

  get(key: string) {
    return await this.customCache.get(key);
  }

  set(key: string, value: string) {
    await this.customCache.set(key, value);
  }

  remove(key: string) {
    await this.customCache.delete(key);
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant