-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: lazy register devtools plugins and reduce unnecessary hook calls (
#693)
- Loading branch information
1 parent
9e8ae0e
commit ffa9367
Showing
3 changed files
with
23 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { devtoolsState } from '../../ctx/state' | ||
import { activeAppRecord, devtoolsState } from '../../ctx/state' | ||
import { registerDevToolsPlugin } from '../plugin' | ||
|
||
export function toggleHighPerfMode(state?: boolean) { | ||
devtoolsState.highPerfModeEnabled = state ?? !devtoolsState.highPerfModeEnabled | ||
if (!state && activeAppRecord.value) { | ||
registerDevToolsPlugin(activeAppRecord.value.app) | ||
} | ||
} |
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