Skip to content

Commit 39f44de

Browse files
ci: apply automated fixes
1 parent 3349a19 commit 39f44de

File tree

14 files changed

+93
-93
lines changed

14 files changed

+93
-93
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
1+
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core'
22

33
export const appConfig: ApplicationConfig = {
44
providers: [provideBrowserGlobalErrorListeners()],
5-
};
5+
}

examples/angular/basic/src/app/app.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
reflectComponentType,
55
signal,
66
Type,
7-
} from '@angular/core';
8-
import { createCounter } from './counter';
9-
import type { TanStackDevtoolsAngularInit } from '@tanstack/angular-devtools';
10-
import { CustomDevtoolPanel } from './devtools/custom-devtools-panel';
11-
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools';
7+
} from '@angular/core'
8+
import { createCounter } from './counter'
9+
import type { TanStackDevtoolsAngularInit } from '@tanstack/angular-devtools'
10+
import { CustomDevtoolPanel } from './devtools/custom-devtools-panel'
11+
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'
1212

1313
@Component({
1414
selector: 'app-root',
@@ -33,10 +33,10 @@ export class App {
3333
name: 'Custom devtools',
3434
render: CustomDevtoolPanel,
3535
},
36-
]);
36+
])
3737

38-
readonly counter = createCounter();
38+
readonly counter = createCounter()
3939

40-
readonly increment = () => this.counter.increment();
41-
readonly decrement = () => this.counter.decrement();
40+
readonly increment = () => this.counter.increment()
41+
readonly decrement = () => this.counter.decrement()
4242
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import { DevtoolsEventClient } from './devtools/eventClient';
2-
import { signal } from '@angular/core';
1+
import { DevtoolsEventClient } from './devtools/eventClient'
2+
import { signal } from '@angular/core'
33

44
export function createCounter() {
5-
const count = signal(0);
6-
const history: Array<number> = [];
5+
const count = signal(0)
6+
const history: Array<number> = []
77

88
return {
99
value: () => count(),
1010
increment: () => {
11-
count.update((n) => n + 1);
12-
history.push(count());
11+
count.update((n) => n + 1)
12+
history.push(count())
1313

1414
// The emit eventSuffix must match that of the EventMap defined in eventClient.ts
1515
DevtoolsEventClient.emit('counter-state', {
1616
count: count(),
1717
history,
18-
});
18+
})
1919
},
2020
decrement: () => {
21-
count.update((n) => n - 1);
22-
history.push(count());
21+
count.update((n) => n - 1)
22+
history.push(count())
2323

2424
DevtoolsEventClient.emit('counter-state', {
2525
count: count(),
2626
history,
27-
});
27+
})
2828
},
29-
};
29+
}
3030
}

examples/angular/basic/src/app/devtools/custom-devtools-panel.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
inject,
77
input,
88
signal,
9-
} from '@angular/core';
10-
import { DevtoolsEventClient } from './eventClient';
11-
import { JsonPipe } from '@angular/common';
9+
} from '@angular/core'
10+
import { DevtoolsEventClient } from './eventClient'
11+
import { JsonPipe } from '@angular/common'
1212

1313
@Component({
1414
selector: `custom-devtool-panel`,
@@ -22,19 +22,19 @@ import { JsonPipe } from '@angular/common';
2222
imports: [JsonPipe],
2323
})
2424
export class CustomDevtoolPanel {
25-
#destroyRef = inject(DestroyRef);
25+
#destroyRef = inject(DestroyRef)
2626

2727
// Automatically added
28-
readonly theme = input<string>();
28+
readonly theme = input<string>()
2929

30-
state = signal<{ count: number; history: Array<number> } | undefined>(undefined);
30+
state = signal<{ count: number; history: Array<number> } | undefined>(undefined)
3131

3232
constructor() {
3333
afterNextRender(() => {
3434
const unsubscribe = DevtoolsEventClient.on('counter-state', (e) => {
35-
this.state.set(e.payload);
36-
});
37-
this.#destroyRef.onDestroy(() => unsubscribe());
38-
});
35+
this.state.set(e.payload)
36+
})
37+
this.#destroyRef.onDestroy(() => unsubscribe())
38+
})
3939
}
4040
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { EventClient } from '@tanstack/devtools-event-client';
1+
import { EventClient } from '@tanstack/devtools-event-client'
22

33
type EventMap = {
4-
'counter-state': { count: number; history: Array<number> };
5-
};
4+
'counter-state': { count: number; history: Array<number> }
5+
}
66

77
class CustomEventClient extends EventClient<EventMap> {
88
constructor() {
99
super({
1010
pluginId: 'custom-devtools',
1111
debug: true,
12-
});
12+
})
1313
}
1414
}
1515

1616
// This is where the magic happens, it'll be used throughout your application.
17-
export const DevtoolsEventClient = new CustomEventClient();
17+
export const DevtoolsEventClient = new CustomEventClient()

examples/angular/basic/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { appConfig } from './app/app.config';
3-
import { App } from './app/app';
1+
import { bootstrapApplication } from '@angular/platform-browser'
2+
import { appConfig } from './app/app.config'
3+
import { App } from './app/app'
44

5-
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
5+
bootstrapApplication(App, appConfig).catch((err) => console.error(err))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
1+
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core'
22

33
export const appConfig: ApplicationConfig = {
44
providers: [provideBrowserGlobalErrorListeners()],
5-
};
5+
}

examples/angular/panel/src/app/app.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
reflectComponentType,
55
signal,
66
Type,
7-
} from '@angular/core';
8-
import { createCounter } from './counter';
9-
import type { TanStackDevtoolsAngularInit } from '@tanstack/angular-devtools';
10-
import { CustomDevtoolPanel } from './devtools/custom-devtools-panel';
11-
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools';
7+
} from '@angular/core'
8+
import { createCounter } from './counter'
9+
import type { TanStackDevtoolsAngularInit } from '@tanstack/angular-devtools'
10+
import { CustomDevtoolPanel } from './devtools/custom-devtools-panel'
11+
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'
1212

1313
@Component({
1414
selector: 'app-root',
@@ -33,10 +33,10 @@ export class App {
3333
name: 'Custom devtools',
3434
render: CustomDevtoolPanel,
3535
},
36-
]);
36+
])
3737

38-
readonly counter = createCounter();
38+
readonly counter = createCounter()
3939

40-
readonly increment = () => this.counter.increment();
41-
readonly decrement = () => this.counter.decrement();
40+
readonly increment = () => this.counter.increment()
41+
readonly decrement = () => this.counter.decrement()
4242
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import { DevtoolsEventClient } from './devtools/eventClient';
2-
import { signal } from '@angular/core';
1+
import { DevtoolsEventClient } from './devtools/eventClient'
2+
import { signal } from '@angular/core'
33

44
export function createCounter() {
5-
const count = signal(0);
6-
const history: Array<number> = [];
5+
const count = signal(0)
6+
const history: Array<number> = []
77

88
return {
99
value: () => count(),
1010
increment: () => {
11-
count.update((n) => n + 1);
12-
history.push(count());
11+
count.update((n) => n + 1)
12+
history.push(count())
1313

1414
// The emit eventSuffix must match that of the EventMap defined in eventClient.ts
1515
DevtoolsEventClient.emit('counter-state', {
1616
count: count(),
1717
history,
18-
});
18+
})
1919
},
2020
decrement: () => {
21-
count.update((n) => n - 1);
22-
history.push(count());
21+
count.update((n) => n - 1)
22+
history.push(count())
2323

2424
DevtoolsEventClient.emit('counter-state', {
2525
count: count(),
2626
history,
27-
});
27+
})
2828
},
29-
};
29+
}
3030
}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import { DevtoolsEventClient } from './eventClient';
2-
import { createAngularPanel } from '@tanstack/angular-devtools/utils';
1+
import { DevtoolsEventClient } from './eventClient'
2+
import { createAngularPanel } from '@tanstack/angular-devtools/utils'
33

44
class BasePanel {
5-
#unsubscribes = [] as Array<() => void>;
6-
#dispose = () => void 0;
5+
#unsubscribes = [] as Array<() => void>
6+
#dispose = () => void 0
77

88
mount<T extends HTMLElement>(element: T) {
9-
const plugin = element.ownerDocument.createElement('div');
10-
element.appendChild(plugin);
9+
const plugin = element.ownerDocument.createElement('div')
10+
element.appendChild(plugin)
1111

1212
function render(count: number, history: string) {
1313
plugin.innerHTML = `
1414
<div>counter state: ${count}</div>
1515
<div>counter history: ${history}</div>
16-
`;
16+
`
1717
}
1818

19-
render(0, '');
19+
render(0, '')
2020

2121
this.#unsubscribes.push(
2222
DevtoolsEventClient.on('counter-state', (e) => {
23-
const count = e.payload.count ?? 0;
24-
const history = JSON.stringify(e.payload.history ?? {});
25-
render(count, history);
23+
const count = e.payload.count ?? 0
24+
const history = JSON.stringify(e.payload.history ?? {})
25+
render(count, history)
2626
}),
27-
);
27+
)
2828

2929
this.#dispose = () => {
30-
plugin.remove();
31-
};
30+
plugin.remove()
31+
}
3232
}
3333

3434
unmount() {
35-
this.#unsubscribes.forEach((unsubscribe) => unsubscribe());
36-
this.#dispose();
35+
this.#unsubscribes.forEach((unsubscribe) => unsubscribe())
36+
this.#dispose()
3737
}
3838
}
3939

40-
export const [CustomDevtoolPanel] = createAngularPanel(BasePanel);
40+
export const [CustomDevtoolPanel] = createAngularPanel(BasePanel)

0 commit comments

Comments
 (0)