-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
How to get it working TypeScript? #14
Comments
I think it's a little too late to answer your question, but the issue could be with the memGot not having a type defined. Instead it can be often improved as below. const memGot = (url:string, opts: GotOptions<string>) => pMemoize(() => got(url, opts), {maxAge: 6000}); It would be better to follow this syntax as the options passed to the got function can be varying and this will help in keeping the code clean. Also the advantage of using p-memoize over mem is explained here. |
Nothing, probably the types are wrong.
No advantage unless you're using
Nothing there mentions |
For anyone else having TS issues with p-memoize, after reading this: "No advantage unless you're using |
Fixes sindresorhus#3, Fixes sindresorhus#14 Signed-off-by: Richie Bendall <richiebendall@gmail.com>
I've followed the example in the
README.md
but I get this:However, replacing
p-memoize
withmem
works just fine in TypeScript without any issues.This leads me to two questions:
p-memoize
properly working with TypeScript?p-memoize
overmem
for using withgot
?The text was updated successfully, but these errors were encountered: