@param {Effect} effect
(effect)
| 3394 | } |
| 3395 | /** @param {Effect} effect */ |
| 3396 | _unsubscribeEffect(effect) { |
| 3397 | var reactivity2 = this; |
| 3398 | for (var [depKey, dep] of effect.dependencies) { |
| 3399 | if (dep.type === "symbol" && dep.scope === "global") { |
| 3400 | var subs = reactivity2._globalSymbolSubscriptions.get(dep.name); |
| 3401 | if (subs) { |
| 3402 | subs.delete(effect); |
| 3403 | if (subs.size === 0) { |
| 3404 | reactivity2._globalSymbolSubscriptions.delete(dep.name); |
| 3405 | } |
| 3406 | } |
| 3407 | } else if (dep.type === "symbol" && dep.scope === "element") { |
| 3408 | var state = reactivity2._getObjectState(dep.element); |
| 3409 | if (state.subscriptions) { |
| 3410 | var subs = state.subscriptions.get(dep.name); |
| 3411 | if (subs) { |
| 3412 | subs.delete(effect); |
| 3413 | if (subs.size === 0) { |
| 3414 | state.subscriptions.delete(dep.name); |
| 3415 | } |
| 3416 | } |
| 3417 | } |
| 3418 | } else if (dep.type === "attribute" && dep.element) { |
| 3419 | var attrState = reactivity2._getObjectState(dep.element); |
| 3420 | var attrKey = dep.name + ":" + attrState.id; |
| 3421 | var subs = reactivity2._attributeSubscriptions.get(attrKey); |
| 3422 | if (subs) { |
| 3423 | subs.delete(effect); |
| 3424 | if (subs.size === 0) { |
| 3425 | reactivity2._attributeSubscriptions.delete(attrKey); |
| 3426 | } |
| 3427 | } |
| 3428 | } else if (dep.type === "property" && dep.object) { |
| 3429 | var propState = reactivity2._getObjectState(dep.object); |
| 3430 | var subs = reactivity2._propertySubscriptions.get(propState.id); |
| 3431 | if (subs) { |
| 3432 | subs.delete(effect); |
| 3433 | if (subs.size === 0) { |
| 3434 | reactivity2._propertySubscriptions.delete(propState.id); |
| 3435 | } |
| 3436 | } |
| 3437 | } else if (dep.type === "query") { |
| 3438 | var subs = reactivity2._querySubscriptions.get(dep.root); |
| 3439 | if (subs) { |
| 3440 | subs.delete(effect); |
| 3441 | if (subs.size === 0) { |
| 3442 | reactivity2._querySubscriptions.delete(dep.root); |
| 3443 | } |
| 3444 | } |
| 3445 | } |
| 3446 | } |
| 3447 | reactivity2._maybeStopGlobalObserver(); |
| 3448 | } |
| 3449 | /** |
| 3450 | * Disconnect the global observer and delegated listeners when no |
| 3451 | * effects depend on DOM state (attributes, properties, or queries). |
no test coverage detected