How to run
npm install
npm start
note
- This demo is using React and Redux
- For the api supplied, RTK Query in Redux Toolkit is used. RTK Query Overview.
- RTK Query has a catch system build in. So, if the request is the same, the cache will be returned and no request will be sent.
- This is configurable via refetchOnMountOrArgChange. I have set the cache to be invalid after 30 seconds.
- Chart lib is Rechart, which does not have trend functionality. To be able to show the trend line, either I have to calculate the equation by myself or change other lib like echart for react. To save time, I just passed this.
- Chart color is green if growth > 80 otherwise is blue.
- Let me know if you have any questions.