-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Any questions should be directed to @vujita --- Replace any ":question:" below with information about your pull request. ## Pull Request Details Provide details about your pull request and what it adds, fixes, or changes. :question: ## Breaking Changes Describe what features are broken by this pull request and why, if any. :question: ## Issues Fixed Enter the issue numbers resolved by this pull request below, if any. 1. :question: ## Other Relevant Information Provide any other important details below. :question: --------- Signed-off-by: Vu Nguyen <[email protected]>
- Loading branch information
Showing
7 changed files
with
80 additions
and
7 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,5 @@ | ||
import { ttiStore } from "./stores/tti"; | ||
|
||
ttiStore.subscribe(() => { | ||
console.log("tti just occurred", ttiStore.getState()); | ||
}); |
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,13 @@ | ||
import ttiPolyfill from "tti-polyfill"; | ||
import { createStore } from "zustand/vanilla"; | ||
|
||
export const ttiStore = createStore<{ | ||
tti: number; | ||
}>((set) => { | ||
void ttiPolyfill.getFirstConsistentlyInteractive().then((r) => { | ||
set({ tti: r ?? performance.now() }); | ||
}); | ||
return { | ||
tti: -1, | ||
}; | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.