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

Comments

@today-
Copy link

@today- 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

@issuehunt-app

This comment has been minimized.

Copy link

@issuehunt-app issuehunt-app bot commented Aug 27, 2019

@issuehunt has funded $40.00 to this issue.


@issuehunt-app

This comment has been minimized.

Copy link

@issuehunt-app issuehunt-app 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.