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

fix: improve perf #764

Merged
merged 2 commits into from Jan 17, 2024
Merged

fix: improve perf #764

merged 2 commits into from Jan 17, 2024

Conversation

alexander-akait
Copy link
Member

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

#763 and improve tooling

Breaking Changes

No

Additional Info

No

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7ee03c9) 90.75% compared to head (3d82774) 90.55%.

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.
📢 Have feedback on the report? Share it here.

@alexander-akait alexander-akait merged commit a7379a9 into master Jan 17, 2024
14 checks passed
@alexander-akait alexander-akait deleted the fix-improve-perf-more branch January 17, 2024 12:34
@@ -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;
Copy link

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hello, yeah, if you want improve types here - feel free to send a PR

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