Skip to content

Functions

TransformProperty

Transform Datastore Property.

TransformProperties are similar to DerivedProperties, but with two main differences: - Instead of acting on the whole model, the transform function is passed the current value of a single property which was specified in the constructor. - Property values are calculated whenthe property being derived from is set, not when the TransformProperty is fetched. This is more efficient for properties that have significant expense to calculate.

TransformProperty can be declared as a regular property, passing the property to operate on and a function as the first arguments, or it can be used as a decorator for the function that does the calculation, with the property to operate on passed as an argument.