Skip to content
Permalink
Browse files
Fixed typos in comments
  • Loading branch information
andykog committed Feb 24, 2017
1 parent 65a895d commit bc4dd19ca81b545eaff891c3f040c4f84c8bda44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
@@ -71,7 +71,7 @@ export class Atom extends BaseAtom implements IAtom {

endBatch();
return !!globalState.trackingDerivation;
// return doesn't really give usefull info, because it can be as well calling computed which calls atom (no reactions)
// return doesn't really give useful info, because it can be as well calling computed which calls atom (no reactions)
// also it could not trigger when calculating reaction dependent on Atom because Atom's value was cached by computed called by given reaction.
}

@@ -59,7 +59,7 @@ export class ComputedValue<T> implements IObservable, IComputedValue<T>, IDeriva
*
* The `compareStructural` property indicates whether the return values should be compared structurally.
* Normally, a computed value will not notify an upstream observer if a newly produced value is strictly equal to the previously produced value.
* However, enabling compareStructural can be convienent if you always produce an new aggregated object and don't want to notify observers if it is structurally the same.
* However, enabling compareStructural can be convenient if you always produce an new aggregated object and don't want to notify observers if it is structurally the same.
* This is useful for working with vectors, mouse coordinates etc.
*/
constructor(public derivation: () => T, public scope: Object | undefined, private compareStructural: boolean, name: string, setter?: (v: T) => void) {
@@ -139,7 +139,7 @@ export function trackDerivedFunction<T>(derivation: IDerivation, f: () => T, con
}

/**
* diffs newObserving with obsering.
* diffs newObserving with observing.
* update observing to be newObserving with unique observables
* notify observers that become observed/unobserved
*/
@@ -20,7 +20,7 @@ export interface IObservable extends IDepTreeNode {
lowestObserverState: IDerivationState; // Used to avoid redundant propagations
isPendingUnobservation: boolean; // Used to push itself to global.pendingUnobservations at most once per batch.

observers: IDerivation[]; // mantain _observers in raw array for for way faster iterating in propagation.
observers: IDerivation[]; // maintain _observers in raw array for for way faster iterating in propagation.
observersIndexes: {}; // map derivation.__mapid to _observers.indexOf(derivation) (see removeObserver)

onBecomeUnobserved();
@@ -160,9 +160,9 @@ function invariantLOS(observable: IObservable, msg) {
/**
* NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly
* It will propagate changes to observers from previous run
* It's hard or maybe inpossible (with reasonable perf) to get it right with current approach
* Hopefully self reruning autoruns aren't a feature people shuold depend on
* Also most basic use cases shuold be ok
* It's hard or maybe impossible (with reasonable perf) to get it right with current approach
* Hopefully self reruning autoruns aren't a feature people should depend on
* Also most basic use cases should be ok
*/

// Called by Atom when its value changes
@@ -200,7 +200,7 @@ export function propagateChangeConfirmed(observable: IObservable) {
// invariantLOS(observable, "confirmed end");
}

// Used by computed when its dependency changed, but we don't wan't to immidiately recompute.
// Used by computed when its dependency changed, but we don't wan't to immediately recompute.
export function propagateMaybeChanged(observable: IObservable) {
// invariantLOS(observable, "maybe start");
if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE) return;

0 comments on commit bc4dd19

Please sign in to comment.