20219: Improve useAsyncInterval testability, add unit test
authorStephen Smith <stephen@curii.com>
Wed, 2 Aug 2023 00:40:13 +0000 (20:40 -0400)
committerStephen Smith <stephen@curii.com>
Wed, 2 Aug 2023 00:40:13 +0000 (20:40 -0400)
commit5430c336b96cbb7c20bffa1cbdb8cffea32fb460
tree9416aeae51bfa328212fc593f5c3e1df0fbcfc51
parentd76aa6ba31074f3d41cef48628b235aab4906ce5
20219: Improve useAsyncInterval testability, add unit test

* Combines useRefs for easier mocking
* Wraps callback execution in promise chain to prevent halting on non-async
  callbacks
* Clean up now unused async contexts
* Add explicit promise resolve/reject on PollProcessLogs
  * Add catch block to continue polling on error

Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>
package.json
src/common/use-async-interval.test.tsx [new file with mode: 0644]
src/common/use-async-interval.ts
src/store/process-logs-panel/process-logs-panel-actions.ts
yarn.lock