Skip to content

Commit

Permalink
Factored out string key access
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Apr 3, 2017
1 parent da2cc5e commit a93cd4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/derivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ function bindDependencies(derivation: IDerivation) {
if (i0 !== i) observing[i0] = dep;
i0++;
}
if (dep['dependenciesState'] > lowestNewObservingDerivationState) {
lowestNewObservingDerivationState = dep['dependenciesState'];

// Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,
// not hitting the condition
if ((dep as any as IDerivation).dependenciesState > lowestNewObservingDerivationState) {
lowestNewObservingDerivationState = (dep as any as IDerivation).dependenciesState;
}
}
observing.length = i0;
Expand Down

0 comments on commit a93cd4d

Please sign in to comment.