-
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.
- Loading branch information
1 parent
86ce4ff
commit c6bb49a
Showing
5 changed files
with
35 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<script> | ||
window.global = window; | ||
window.__debug_react_done_tracker = true; | ||
</script> |
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 @@ | ||
declare global { | ||
// eslint-disable-next-line no-var | ||
var __debug_react_done_tracker: boolean; | ||
} | ||
export const DEBUG = typeof globalThis === "object" && globalThis.__debug_react_done_tracker; |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
export const debug = console.debug.bind(window.console, "[Done Tracker]"); | ||
export const log = console.log.bind(window.console, "[Done Tracker]"); | ||
export const warn = console.warn.bind(window.console, "[Done Tracker]"); | ||
import { DEBUG } from "./debug"; | ||
|
||
export const debug = DEBUG | ||
? console.debug.bind(window.console, "[Done Tracker]") | ||
: () => undefined; | ||
export const log = DEBUG | ||
? console.log.bind(window.console, "[Done Tracker]") | ||
: () => undefined; | ||
export const warn = DEBUG | ||
? console.warn.bind(window.console, "[Done Tracker]") | ||
: () => undefined; |
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