-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fe): abort outdated requests (#1317)
* feat: abort outdated requests * test: abort on Data Fetch * feat: use the aborted status instead of timestamps * feat: remove unused variable * test: add mocks * feat: reset some values on request finished * test: improve mock * Revert "feat: reset some values on request finished" This reverts commit b1eb250. * test: improve mock further
- Loading branch information
1 parent
4d938ca
commit 50fc154
Showing
6 changed files
with
227 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import MockAbortSignal from "./MockAbortSignal"; | ||
|
||
export default class MockAbortController { | ||
signal = new MockAbortSignal(); | ||
|
||
abort(): void { | ||
this.signal.dispatchEvent(new Event("abort")); | ||
this.signal.aborted = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default class MockAbortSignal extends EventTarget { | ||
aborted = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.