private _handleAutoSubscribe()

in src/ComponentBase.ts [144:163]


    private _handleAutoSubscribe(store: StoreBase, key: string): void {
        // Check for an existing auto-subscription.
        const autoSubscription = this._findMatchingAutoSubscription(store, key);
        if (autoSubscription) {
            // Set auto-subscription as used
            autoSubscription.used = true;
            return;
        }

        // None found: auto-subscribe!
        const subscription: AutoSubscription = {
            store: store,
            // Note: an undefined specificKeyValue will use Key_All by default.
            key: key,
            callback: this._onAutoSubscriptionChanged,
            used: true,
        };
        this._handledAutoSubscriptions.push(subscription);
        subscription.store.trackAutoSubscription(subscription);
    }