Skip to content

Commit

Permalink
update computedvalue constructor jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiewinder committed Apr 15, 2017
1 parent 61939a9 commit 8abf3d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/core/computedvalue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ export class ComputedValue<T> implements IObservable, IComputedValue<T>, IDeriva
*
* The `name` property is for debug purposes only.
*
* JW: Update
* 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 convenient if you always produce an new aggregated object and don't want to notify observers if it is structurally the same.
* The `equals` property specifies the comparer function to use to determine if a newly produced
* value differs from the previous value. Two comparers are provided in the library; `defaultComparer`
* compares based on identity comparison (===), and `structualComparer` deeply compares the structure.
* Structural comparison 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 equals: IEqualsComparer<any>, name: string, setter?: (v: T) => void) {
Expand Down

0 comments on commit 8abf3d1

Please sign in to comment.