jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.55k stars 295 forks source link

Cache a request response #3634

Open dicolasi opened 3 days ago

dicolasi commented 3 days ago

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