radashi-org / radashi

The modern, community-first TypeScript toolkit with all of the fast, readable, and minimal utility functions you need. Type-safe, dependency-free, tree-shakeable, fully tested.
https://radashi.js.org
MIT License
315 stars 25 forks source link

fix(types): avoid inferring `memo` return type from `key` option #231

Closed aleclarson closed 3 months ago

aleclarson commented 3 months ago

[!TIP] The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Avoid inferring the memo return type from any of the given options, like the key callback.

See the added type tests for two examples.

Related issue, if any:

Closes #230

For any code change,

Does this PR introduce a breaking change?

No