thibaultboursier / use-timer

A timer hook for React
MIT License
198 stars 24 forks source link

Missing payload. #51

Closed dancheskus closed 4 years ago

dancheskus commented 4 years ago

https://github.com/thibaultboursier/use-timer/blob/250d8c91fdc843fa6e5e276f0c726ba803a37a34/src/useTimer.ts#L41

dispatch requires payload here

Argument of type '{ type: "start"; }' is not assignable to parameter of type '{ type: "advanceTime"; payload: { timeToAdd: number; }; } | { type: "pause"; } | { type: "reset"; payload: { initialTime: number; }; } | { type: "set"; payload: { newTime: number; }; } | { type: "start"; payload: { ...; }; } | { ...; }'. Property 'payload' is missing in type '{ type: "start"; }' but required in type '{ type: "start"; payload: { initialTime: number; }; }'.

dancheskus commented 4 years ago

image

thibaultboursier commented 4 years ago

Yes, it's just a merge issue (between two PRs) on develop, i'll fix it. Or you can make a PR to fix it if you want ;-) Just need to add the second parameter.

dancheskus commented 4 years ago

I'll make it

dancheskus commented 4 years ago

should I fork your project? I cannot push to your repo.

thibaultboursier commented 4 years ago

Yes, but too late, i'm going to fix it now 😜

thibaultboursier commented 4 years ago

It's fixed.