• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gauntface / focus-frontend / 19524050404

20 Nov 2025 03:01AM UTC coverage: 48.544% (-25.1%) from 73.684%
19524050404

push

github

web-flow
Tanstack (#313)

* WIP

* Update more pages over to tanstack

* Linting run

* Remove old pages that have been migrated

* Fix up the build

* Add build ci

* Migrate some of the tests

* Some more tests

* Migrate remaining tests

* Migrate remaining tests

* CI ready hopefully

* Make eslint happier

* Try mode with vitest

* Update test env

* rm .only()

* Add coverage to vitest

* Fix build and test

* Run with coverage

20 of 37 branches covered (54.05%)

Branch coverage included in aggregate %.

98 of 223 new or added lines in 29 files covered. (43.95%)

130 of 272 relevant lines covered (47.79%)

2.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.25
/src/utils/useDelayedState.ts
1
import {  toast } from "react-toastify";
2
import type {ToastPromiseParams} from "react-toastify";
3

4
export class DelayAPI {
5
        private timeout: number;
6
        private timeoutID: NodeJS.Timeout | undefined;
7
        private promise: Promise<void> | undefined;
8
        private cb: () => Promise<void>;
9
        private queueCb: (value: unknown) => void;
10
        private toastID: string;
11
        private toastPromiseParams: ToastPromiseParams;
12

13
        constructor(
14
                timeout: number,
15
                toastID: string,
16
                toastPromiseParams: ToastPromiseParams,
17
        ) {
18
                this.timeout = timeout;
14✔
19
                this.queueCb = () => {
14✔
20
                        // NOOP
21
                };
22
                this.cb = async () => {
14✔
23
                        // NOOP
24
                };
25
                this.toastID = toastID;
14✔
26
                this.toastPromiseParams = toastPromiseParams;
14✔
27
        }
28

29
        queue(cb: () => Promise<void>) {
30
                clearTimeout(this.timeoutID);
×
31
                this.cb = cb;
×
32

33
                if (!this.promise) {
×
34
                        this.promise = new Promise((resolve) => {
×
35
                                this.queueCb = resolve;
×
36
                        })
NEW
37
                                .then(() => this.cb())
×
38
                                .then(() => {
NEW
39
                                        this.promise = undefined;
×
40
                                });
41

NEW
42
                        toast.promise(this.promise, this.toastPromiseParams, {
×
43
                                toastId: this.toastID,
44
                        });
45
                }
46

47
                this.timeoutID = setTimeout(this.queueCb, this.timeout);
×
48
                return this.promise;
×
49
        }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc