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

Cache a request response #3634

Open
2 tasks done
dicolasi opened this issue Sep 30, 2024 · 1 comment
Open
2 tasks done

Cache a request response #3634

dicolasi opened this issue Sep 30, 2024 · 1 comment
Labels
question type:documentation Changes only affect the documentation

Comments

@dicolasi
Copy link

dicolasi commented Sep 30, 2024

Description
Hi all, I cannot find anything in documention that suggests how to create a custom requesterFn. In can see that the method signature it expects is (resourceOptions: ResourceOptions) => RequesterType but I cannot even import those types.
What I am trying to achieve it to simply use a cache library (like https://www.npmjs.com/package/flat-cache) to check if the data has been already asked, and return it if cache hit... or ask for the data in case of cache miss.
If anyone can help would be great (if you have an example I could use even better :) )

I would like to create a custom requesterFn that cache the response.

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.
@ahedadja
Copy link

@jdalrymple I would also like to know how to implement a custom requester function. I tried to look through the docs for one because I noticed it was required but didn't find anything. Do you mind posting or linking an example of how this would be done please?

@jdalrymple jdalrymple added the type:documentation Changes only affect the documentation label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question type:documentation Changes only affect the documentation
Projects
None yet
Development

No branches or pull requests

3 participants