Skip to content

Conversation

ylyra
Copy link

@ylyra ylyra commented May 25, 2025

Hi there! First of all, I really loved the project.

Noticed that in the examples, you’re using @ts-ignore because of the custom hooks. This PR address that. It is not be the most elegant solution, but it works well 😬.

@brandonmcconnell brandonmcconnell self-requested a review May 28, 2025 20:11
@brandonmcconnell
Copy link
Owner

@ylyra Thanks for the PR 🙂

Could you rework this to use the declared Fn type instead of any?
This should also remove the need for & { length?: never; }

Once that's done, remove that @ts-ignore statement and make sure the package still builds and all tests pass.

Thanks again!

@ylyra
Copy link
Author

ylyra commented May 29, 2025

Hi @brandonmcconnell

With the declared Fn, it doesn’t really work right. TypeScript kinda gets lost (like you can see in the screenshot), and the types for each custom function disappear.

image

I tweaked it a bit to still use any, but now it checks if the passed value extends Fn.

Also removed the & { length?: never; } and @ts-ignore

Now
image

Tks

@brandonmcconnell
Copy link
Owner

@ylyra Thanks for the update! I'll check this over the weekend. The fix might be fine, but I'm weary of using any anywhere, as it can be a slippery slope for loose-type checking.

@ylyra
Copy link
Author

ylyra commented May 29, 2025

Awesome, thanks.

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.

2 participants