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

createEffect doesn't resolve void Params #106

Closed
today- opened this issue May 24, 2019 · 2 comments · Fixed by #189
Closed

createEffect doesn't resolve void Params #106

today- opened this issue May 24, 2019 · 2 comments · Fixed by #189
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt typings Typescript public type definitions issues

Comments

@today-
Copy link

today- commented May 24, 2019

Issuehunt badges

I have this code:

const handler = () => console.log();

const effect = createEffect('', {handler});

effect();

I got TS2554: Expected 1 arguments, but got 0. An argument for payload was not provided

So, I have to manually declare effect typings like this:

const effect = createEffect<void, void, any>('', {handler});

Or write wrappers:

const createBetterEffect = <Params = void, Done = any>(
  name?: string,
  options?: {handler?: (() => Done | Promise<Done>) | ((p: Params) => Done | Promise<Done>)},
) =>
  createEffect<Params, Done, string>(name, options);

I want createEffect to correctly infer void type of Params


IssueHunt Summary

goodmind goodmind has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@today- today- added the typings Typescript public type definitions issues label May 24, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Aug 27, 2019

@issuehunt has funded $40.00 to this issue.


@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Aug 27, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Aug 30, 2019

@zerobias has rewarded $28.00 to @goodmind. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(20%): $8.00
  • 🔧 Service fee(10%): $4.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt typings Typescript public type definitions issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant