Hi there! Welcome to the project. We're glad you're here.
- Wrap rpc calls in useCallback. This one should not have empty dependency array (but don't omit it entirely, or it will run on every render!)
- The useCallback result is a function. Assign it to a constant
- Call the function from inside useEffect. Dependency array will include the function -- that's okay, the function never changes, so it won't trigger the effect.
Do not put rpcClient into any dependency arrays (just in case).
Actually, pure event handlers don't need to be wrapped (I think). But anything called from inside a useCallback does need to be wrapped.
- Call humanXYZ() when user does XYZ. This sends updateTask and then returns to indicate complete.
- Immediately after, call startBotTurn() (returns immediately), which takes care of figuring out what to do to get back to human control.
- Call stopBotTurn() if needed.
All task updates are sent via updateTask. eventually there will be an endBotTurn notification, but we don't need it yet.
Problem: Unable to launch browser: Could not connect to debug target at http://localhost:9222: Could not find any debuggable target
Solution: restart vscode
Solution: run yarn watch