There are 2 primary JavaScript scheduling methods,
Here is a demo of how to use them with React Hooks.