amplitude / redux-query

A library for managing network state in Redux
https://amplitude.github.io/redux-query
Other
1.1k stars 67 forks source link

Feature/hacker news #202

Closed TheCarlR closed 4 years ago

TheCarlR commented 4 years ago

This is the hacker-news sample implemented in TypeScript with strict compilation. Important passages are commented with guidance. The sample builds on the react toolkit's CRA typescript template.

rctbusk commented 4 years ago

Hey @TheCarlR! Thanks for adding an example. Curious what the motivation behind adding this was?

TheCarlR commented 4 years ago

We use redux-query in a project I just started in, and there was issues with it. Especially making the interfaces work with strict compilation, so having your hacker news sample in TypeScript as a source of truth was very valuable for me. @rctbusk

rctbusk commented 4 years ago

So, just in general, my comment is that we don't actually store example code in this codebase. We use codesandbox and add the links to the website and readme. This reduces the size of the repo and allows us to make changes to examples without having to push PRs.

So my question to you would be are you willing to write up this example in codesandbox, and then I will fork it and add the link to our documentation? I do think this is a super valuable example to have, especially since typescript is huge and most likely is what people will be using.

TheCarlR commented 4 years ago

Yes, sure. I'll fix it.

TheCarlR commented 4 years ago

@rctbusk Sample up here now: https://codesandbox.io/s/redux-query-hacker-news-sample-in-typescript-ufl2n Looks correct?

rctbusk commented 4 years ago

Looks great! I will open this as a PR to the docs and readme in the next few days. This is a super valuable example and we definitely appreciate the help.