app/assets/javascripts/stimulus-loading.js in stimulus-rails-1.0.3 vs app/assets/javascripts/stimulus-loading.js in stimulus-rails-1.0.4
- old
+ new
@@ -76,8 +76,10 @@
function controllerFilename(name, under) {
return `${under}/${name.replace(/--/g, "/").replace(/-/g, "_")}_controller`
}
function registerController(name, module, application) {
- application.register(name, module.default)
- registeredControllers[name] = true
+ if (!(name in registeredControllers)) {
+ application.register(name, module.default)
+ registeredControllers[name] = true
+ }
}