Skip to content

Commit f681ec8

Browse files
committed
Remove unnecessary function
1 parent d764aff commit f681ec8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/StimulusBundle/assets/src/loader.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ class StimulusLazyControllerHandler {
6464
}
6565

6666
private lazyLoadExistingControllers(element: Element) {
67-
this.queryControllerNamesWithin(element).forEach((controllerName) => this.loadLazyController(controllerName));
67+
Array.from(element.querySelectorAll(`[${controllerAttribute}]`)).flatMap(extractControllerNamesFrom).forEach(
68+
(controllerName) => this.loadLazyController(controllerName)
69+
);
6870
}
6971

7072
private async loadLazyController(name: string) {
@@ -106,10 +108,6 @@ class StimulusLazyControllerHandler {
106108
childList: true,
107109
});
108110
}
109-
110-
private queryControllerNamesWithin(element: Element): string[] {
111-
return Array.from(element.querySelectorAll(`[${controllerAttribute}]`)).flatMap(extractControllerNamesFrom);
112-
}
113111
}
114112

115113
function registerController(name: string, controller: ControllerConstructor, application: Application) {

0 commit comments

Comments
 (0)