Skip to content

Commit

Permalink
Fixed typos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kogut committed Feb 24, 2017
1 parent 65a895d commit bc4dd19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/atom.ts
Expand Up @@ -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.
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/computedvalue.ts
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/derivation.ts
Expand Up @@ -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
*/
Expand Down
10 changes: 5 additions & 5 deletions src/core/observable.ts
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bc4dd19

Please sign in to comment.