micahgodbolt / fluid-react-starter

MIT License
3 stars 2 forks source link

added typing to actions and queries #23

Closed sumedhb1995 closed 3 years ago

micahgodbolt commented 3 years ago

Love it! Still a bit manual, but better than nothing!

sumedhb1995 commented 3 years ago

Love it! Still a bit manual, but better than nothing!

Well technically, you can now drop the entire typing on the actual actions/query functions themselves in the props passed to useGetStore at this point and it will automatically interpret their typings from the type set for the props using the generics passed in. They are just maintained rn for easier readability.

So, similar amount of manual typing but we get the advantage of being able to process the types themselves since they are now statically available instead of being in parameters to a function call.