Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
==========================================
- Coverage 90.75% 90.55% -0.21%
==========================================
Files 2 2
Lines 422 413 -9
Branches 121 120 -1
==========================================
- Hits 383 374 -9
Misses 38 38
Partials 1 1 ☔ View full report in Codecov by Sentry. |
| @@ -39,9 +39,3 @@ export function throttleAll<T>(limit: number, tasks: Task<T>[]): Promise<T[]>; | |||
| * @returns {function(): T} | |||
| */ | |||
| export function memoize<T>(fn: (() => any) | undefined): () => T; | |||
There was a problem hiding this comment.
I don't know anything about the packae and these things, so please tell me if I'm off :)
I find it strange and not type-sae at all that the function we pass returns any. Also I doubt we can pass undefined as a function because it's called directly...
So shouldn't the type be more something like:
export function memoize<T>(fn: () => T): () => T;Maybe you wanted undefined because of the line fn = undefined; in the function. It might be better (for types) to keep fn in a separate variable that can be undefined, so that the parameter itself can't be.
There was a problem hiding this comment.
Hello, yeah, if you want improve types here - feel free to send a PR
This PR contains a:
Motivation / Use-Case
#763 and improve tooling
Breaking Changes
No
Additional Info
No