Skip to content

Commit

Permalink
Dedupe API docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed May 11, 2017
1 parent d5b282f commit e97a6eb
Showing 1 changed file with 24 additions and 63 deletions.
87 changes: 24 additions & 63 deletions lib/mixins/property-effects.html
Expand Up @@ -1130,41 +1130,9 @@
// Prototype setup ----------------------------------------

/**
* Ensures an accessor exists for the specified property, and adds
* to a list of "property effects" that will run when the accessor for
* the specified property is set. Effects are grouped by "type", which
* roughly corresponds to a phase in effect processing. The effect
* metadata should be in the following form:
*
* {
* fn: effectFunction, // Reference to function to call to perform effect
* info: { ... } // Effect metadata passed to function
* trigger: { // Optional triggering metadata; if not provided
* name: string // the property is treated as a wildcard
* structured: boolean
* wildcard: boolean
* }
* }
*
* Effects are called from `_propertiesChanged` in the following order by
* type:
*
* 1. COMPUTE
* 2. PROPAGATE
* 3. REFLECT
* 4. OBSERVE
* 5. NOTIFY
*
* Effect functions are called with the following signature:
*
* effectFunction(inst, path, props, oldProps, info, hasPaths)
*
* This method may be called either on the prototype of a class
* using the PropertyEffects mixin (for best performance), or on
* an instance to add dynamic effects. When called on an instance or
* subclass of a class that has already had property effects added to
* its prototype, the property effect lists will be cloned and added as
* own properties of the caller.
* Equivalent to static `addPropertyEffect` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Property that should trigger the effect
* @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES
Expand Down Expand Up @@ -1882,14 +1850,9 @@
}

/**
* Creates a read-only accessor for the given property.
*
* To set the property, use the protected `_setProperty` API.
* To create a custom protected setter (e.g. `_setMyProp()` for
* property `myProp`), pass `true` for `protectedSetter`.
*
* Note, if the property will have other property effects, this method
* should be called first, before adding other effects.
* Equivalent to static `createReadOnlyProperty` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Property name
* @param {boolean=} protectedSetter Creates a custom protected setter
Expand All @@ -1906,7 +1869,9 @@
}

/**
* Creates a single-property observer for the given property.
* Equivalent to static `createPropertyObserver` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Property name
* @param {string} methodName Name of observer method to call
Expand All @@ -1927,11 +1892,9 @@
}

/**
* Creates a multi-property "method observer" based on the provided
* expression, which should be a string in the form of a normal Javascript
* function signature: `'methodName(arg1, [..., argn])'`. Each argument
* should correspond to a property or path in the context of this
* prototype (or instance), or may be a literal string or number.
* Equivalent to static `createMethodObserver` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} expression Method expression
* @param {Object=} dynamicFns Map indicating whether method names should
Expand All @@ -1947,8 +1910,9 @@
}

/**
* Causes the setter for the given property to dispatch `<property>-changed`
* events to notify of changes to the property.
* Equivalent to static `createNotifyingProperty` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Property name
* @protected
Expand All @@ -1964,8 +1928,9 @@
}

/**
* Causes the setter for the given property to reflect the property value
* to a (dash-cased) attribute of the same name.
* Equivalent to static `createReflectedProperty` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Property name
* @protected
Expand All @@ -1986,11 +1951,9 @@
}

/**
* Creates a computed property whose value is set to the result of the
* method described by the given `expression` each time one or more
* arguments to the method changes. The expression should be a string
* in the form of a normal Javascript function signature:
* `'methodName(arg1, [..., argn])'`
* Equivalent to static `createComputedProperty` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* @param {string} property Name of computed property to set
* @param {string} expression Method expression
Expand Down Expand Up @@ -2153,11 +2116,9 @@
// -- binding ----------------------------------------------

/**
* Parses the provided template to ensure binding effects are created
* for them, and then ensures property accessors are created for any
* dependent properties in the template. Binding effects for bound
* templates are stored in a linked list on the instance so that
* templates can be efficiently stamped and unstamped.
* Equivalent to static `bindTemplate` API but can be called on
* an instance to add effects at runtime. See that method for
* full API docs.
*
* This method may be called on the prototype (for prototypical template
* binding, to avoid creating accessors every instance) once per prototype,
Expand Down

0 comments on commit e97a6eb

Please sign in to comment.