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

Custom storage #1

Open
ericclemmons opened this issue Mar 31, 2013 · 2 comments
Open

Custom storage #1

ericclemmons opened this issue Mar 31, 2013 · 2 comments

Comments

@ericclemmons
Copy link

First, great library. I'm using it extensively and will have some upcoming PRs.

But first, I wanted to ask how you think custom storage adapters should work. Ideally, I would like to be able to use my own custom implementation:

storage: {
  adapter: require('./store/file'),
  options: {
    path: '~/tmp`
  }
}

This would also require that my local lib has access to lib/store/store.js, which is the prototype for all other stores.

How would you like to go about this?

@matteoagosti
Copy link
Owner

Hi @ericclemmons and thank you for your feedback.
Regarding the store it wasn't meant to be extended outside the lib, rather to add additional store to the lib itself. For example a file storage could be potentially of great use also for others.

We could however think about exporting the store API so that it can be extended by simply gaining access to a static RequestCaching.Store and then refactor the config options as you proposed.

What do you think about that?

@ericclemmons
Copy link
Author

I agree that submitting a PR would be ideal.

First, though, it would be very easy to have a working implementation if I could push a custom store locally using the method you mentioned (or similar).

Then I could easily abstract out something functional into a PR and get it into the core.

Let me know how I can help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants