demo/bower_components/knockoutjs/src/subscribables/dependentObservable.js
function computedBeginDependencyDetectionCallback(subscribable, id) {
    var computedObservable = this.computedObservable,
        state = computedObservable[computedState];
    if (!state.isDisposed) {
        if (this.disposalCount && this.disposalCandidates[id]) {
            // Don't want to dispose this subscription, as it's still being used
            computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]);
            this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway
            --this.disposalCount;
        } else if (!state.dependencyTracking[id]) {
            // Brand new subscription - add it
            computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable));
        }
        // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks)
        if (subscribable._notificationIsPending) {
            subscribable._notifyNextChangeIfValueIsDifferent();
        }
    }
}
function computedBeginDependencyDetectionCallback(subscribable, id) {
    var computedObservable = this.computedObservable,
        state = computedObservable[computedState];
    if (!state.isDisposed) {
        if (this.disposalCount && this.disposalCandidates[id]) {
            // Don't want to dispose this subscription, as it's still being used
            computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]);
            this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway
            --this.disposalCount;
        } else if (!state.dependencyTracking[id]) {
            // Brand new subscription - add it
            computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable));
        }
        // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks)
        if (subscribable._notificationIsPending) {
            subscribable._notifyNextChangeIfValueIsDifferent();
        }
    }
}
function computedBeginDependencyDetectionCallback ( subscribable , id ) { var computedObservable = this . computedObservable , state = computedObservable [ computedState ] ; if ( ! state . isDisposed ) { if ( this . disposalCount && this . disposalCandidates [ id ] ) { // Don't want to dispose this subscription, as it's still being used computedObservable . addDependencyTracking ( id , subscribable , this . disposalCandidates [ id ] ) ; this . disposalCandidates [ id ] = null ; // No need to actually delete the property - disposalCandidates is a transient object anyway -- this . disposalCount ; } else if ( ! state . dependencyTracking [ id ] ) { // Brand new subscription - add it computedObservable . addDependencyTracking ( id , subscribable , state . isSleeping ? { _target : subscribable } : computedObservable . subscribeToDependency ( subscribable ) ) ; } // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks) if ( subscribable . _notificationIsPending ) { subscribable . _notifyNextChangeIfValueIsDifferent ( ) ; } } }
This function gets called each time a dependency is detected while evaluating a computed. It's factored out as a shared function to avoid creating unnecessary function instances during evaluation.
This function gets called each time a dependency is detected while evaluating a computed . It s factored out as a shared function to avoid creating unnecessary function instances during evaluation .