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

useCache option with tests #37

Merged
merged 3 commits into from
Oct 12, 2019
Merged

useCache option with tests #37

merged 3 commits into from
Oct 12, 2019

Conversation

simoneb
Copy link
Owner

@simoneb simoneb commented Oct 12, 2019

Builds on top of #34 and includes tests and a refactored implementation which reduces duplication

@simoneb simoneb changed the title Verekia master useCache option with tests Oct 12, 2019
@simoneb simoneb mentioned this pull request Oct 12, 2019
Copy link
Contributor

@verekia verekia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you, and nice cleanup :)

@simoneb simoneb merged commit 8593fcd into master Oct 12, 2019
@simoneb simoneb deleted the verekia-master branch October 12, 2019 15:47
@simoneb simoneb restored the verekia-master branch October 19, 2019 15:26
@fabn
Copy link

fabn commented Apr 2, 2020

@simoneb I need same thing as in #33 I saw the useCache option but I'm using makeUseAxios.

I cannot make useCache working with this code

export const useApi = makeUseAxios({axios: api, useCache: false});
export const useApi = makeUseAxios({axios: api, cache: false});

Is there any way to skip cache when using makeUseAxios?

@fabn
Copy link

fabn commented Apr 2, 2020

P.S. for now I found this workaround:

export const useApi = makeUseAxios({axios: api, cache: new LRU({ max: 10, maxAge: 50 })});

but I think is better to have a way to disable it when not needed.

@simoneb
Copy link
Owner Author

simoneb commented Apr 2, 2020

@fabn currently not supported, please create a feature request

@simoneb simoneb deleted the verekia-master branch April 2, 2020 14:00
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

Successfully merging this pull request may close these issues.

None yet

3 participants