diff --git a/src/core/module.ts b/src/core/module.ts index 5635abca..624c02aa 100644 --- a/src/core/module.ts +++ b/src/core/module.ts @@ -31,8 +31,11 @@ export class Module { connectContextForScope(scope: Scope) { const context = this.fetchContextForScope(scope) - this.connectedContexts.add(context) - context.connect() + + if (!this.connectedContexts.has(context)) { + this.connectedContexts.add(context) + context.connect() + } } disconnectContextForScope(scope: Scope) { diff --git a/src/core/router.ts b/src/core/router.ts index d0d40a84..aaec6b21 100644 --- a/src/core/router.ts +++ b/src/core/router.ts @@ -79,7 +79,7 @@ export class Router implements ScopeObserverDelegate { const scope = this.scopeObserver.parseValueForElementAndIdentifier(element, identifier) if (scope) { - this.scopeObserver.elementMatchedValue(scope.element, scope) + this.scopeConnected(scope) } else { console.error(`Couldn't find or create scope for identifier: "${identifier}" and element:`, element) }