mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
style: format Context component modules
This commit is contained in:
1 parent
fc369cc65a
commit
3e078ef49d
11 files changed
+1175
-801
No files matched your search
@@ -58,12 +58,22 @@ try {
|
||||
counts.cctv++;
|
||||
return cctvUnsubscribe();
|
||||
};
|
||||
const contextFields = ['_contextManagerUnsubscribe', '_dataManagerVisibilityRequestUnsubscribe', '_dataManagerVisibilityGuardUnsubscribe', '_dataManagerBeforeDestroyUnsubscribe'];
|
||||
const contextConnected = contextFields.every((field) => typeof ui._contextControls[field] === 'function');
|
||||
const contextFields = [
|
||||
'_contextManagerUnsubscribe',
|
||||
'_dataManagerVisibilityRequestUnsubscribe',
|
||||
'_dataManagerVisibilityGuardUnsubscribe',
|
||||
'_dataManagerBeforeDestroyUnsubscribe',
|
||||
];
|
||||
const contextConnected = contextFields.every(
|
||||
(field) => typeof ui._contextControls[field] === 'function',
|
||||
);
|
||||
for (const field of contextFields) {
|
||||
const unsubscribe = ui._contextControls[field];
|
||||
counts[field] = 0;
|
||||
ui._contextControls[field] = () => { counts[field]++; return unsubscribe?.(); };
|
||||
ui._contextControls[field] = () => {
|
||||
counts[field]++;
|
||||
return unsubscribe?.();
|
||||
};
|
||||
}
|
||||
const resizeHandler = ui._windowResizeHandler;
|
||||
const removeEventListener = window.removeEventListener;
|
||||
@@ -86,8 +96,13 @@ try {
|
||||
resizeHandler &&
|
||||
observed.includes('_commandDockTrayObserver'),
|
||||
),
|
||||
contextReleased: contextConnected && ui._contextControls.destroyed
|
||||
&& contextFields.every((field) => counts[field] === 1 && ui._contextControls[field] === null),
|
||||
contextReleased:
|
||||
contextConnected &&
|
||||
ui._contextControls.destroyed &&
|
||||
contextFields.every(
|
||||
(field) =>
|
||||
counts[field] === 1 && ui._contextControls[field] === null,
|
||||
),
|
||||
observersReleased: observed.every(
|
||||
(name) => counts[name] === 1 && ui[name] === null,
|
||||
),
|
||||
@@ -108,7 +123,10 @@ try {
|
||||
'real UI has the expected live resources before disposal',
|
||||
result.connected,
|
||||
);
|
||||
check('UI disposal releases all Context subscriptions and stops its controls', result.contextReleased);
|
||||
check(
|
||||
'UI disposal releases all Context subscriptions and stops its controls',
|
||||
result.contextReleased,
|
||||
);
|
||||
check(
|
||||
'UI disposal disconnects each active panel observer once',
|
||||
result.observersReleased,
|
||||
|
||||
Reference in new issue
Block a user