Recursive setTimeout with React Hooks

I’m working on a project at the moment where I need to be able to poll an API periodically and I’m building the application using React. I hadn’t had a chance to play with React Hooks yet so I took this as an opportunity to learn a bi…


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail

I’m working on a project at the moment where I need to be able to poll an API periodically and I’m building the application using React. I hadn’t had a chance to play with React Hooks yet so I took this as an opportunity to learn a bit about them and see how to solve something that I would normally have done with class-based components and state, but do it with Hooks.


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail


Print Share Comment Cite Upload Translate
APA
Posts on LINQ to Fail | Sciencx (2022-09-29T22:09:00+00:00) » Recursive setTimeout with React Hooks. Retrieved from https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/.
MLA
" » Recursive setTimeout with React Hooks." Posts on LINQ to Fail | Sciencx - Monday September 23, 2019, https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/
HARVARD
Posts on LINQ to Fail | Sciencx Monday September 23, 2019 » Recursive setTimeout with React Hooks., viewed 2022-09-29T22:09:00+00:00,<https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/>
VANCOUVER
Posts on LINQ to Fail | Sciencx - » Recursive setTimeout with React Hooks. [Internet]. [Accessed 2022-09-29T22:09:00+00:00]. Available from: https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/
CHICAGO
" » Recursive setTimeout with React Hooks." Posts on LINQ to Fail | Sciencx - Accessed 2022-09-29T22:09:00+00:00. https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/
IEEE
" » Recursive setTimeout with React Hooks." Posts on LINQ to Fail | Sciencx [Online]. Available: https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/. [Accessed: 2022-09-29T22:09:00+00:00]
rf:citation
» Recursive setTimeout with React Hooks | Posts on LINQ to Fail | Sciencx | https://www.scien.cx/2019/09/23/recursive-settimeout-with-react-hooks/ | 2022-09-29T22:09:00+00:00
https://github.com/addpipe/simple-recorderjs-demo