Skip to content

Commit c7404eb

Browse files
committed
Replace unsafe any type with proper typing for pollingDirector
1 parent af1ead5 commit c7404eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LiveComponent/assets/src/Component/plugins/PollingPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ export default class implements PluginInterface {
77
private element: Element;
88
private pollingDirector: PollingDirector;
99

10-
attachToComponent(component: Component): void {
10+
attachToComponent(component: Component & { pollingDirector?: PollingDirector }): void {
1111
this.element = component.element;
1212
this.pollingDirector = new PollingDirector(component);
1313
this.initializePolling();
1414

1515
// access from stimulus_controller
16-
(component as any).pollingDirector = this.pollingDirector;
16+
component.pollingDirector = this.pollingDirector;
1717

1818
component.on('connect', () => {
1919
this.pollingDirector.startAllPolling();

0 commit comments

Comments
 (0)