conorhastings / use-reducer-with-side-effects

MIT License
88 stars 18 forks source link

Migrate to Typescript #37

Closed szg251 closed 3 years ago

szg251 commented 4 years ago

I migrated the vanilla JS to TypeScript, so the library can be used in both JS and TS. If you don't want to switch to TypeScript, the generated definitions could still be used.

I tried to only add type definitions without changing anything in the code, but in a few places I had to change a few things to satisfy the TS compiler.

szg251 commented 4 years ago

@conorhastings Hi! I by no means want to force TypeScript onto this project, but if you like the idea, could you check my PR? I believe TS typings are almost a requirement for any NPM package these days, and it is easier and safer to maintain, if the project itself is written in TS.

conorhastings commented 4 years ago

I'm not a big typescript user but I'm not opposed, sorry for the delayed response, can you explain the changes you had to make beffore I merge this in