nested
Annotation for nested objects
Remarks
Section titled “Remarks”- Mixed nested modes for the same key are not allowed
- Two annotated members that resolve to the same key path are not allowed, since the key path is the address the nested object is reached by
Call Signature
Section titled “Call Signature”nested(
target,propertyKey):void
Defined in: nested.ts:30
Parameters
Section titled “Parameters”target
Section titled “target”object
propertyKey
Section titled “propertyKey”string | symbol
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”nested(
value,context):void| ((this:object) =>any)
Defined in: nested.ts:30
Parameters
Section titled “Parameters”(this: object) => any
context
Section titled “context”ClassGetterDecoratorContext
Returns
Section titled “Returns”void | ((this: object) => any)
Call Signature
Section titled “Call Signature”nested(
value,context):void|ClassAccessorDecoratorResult<object,any>
Defined in: nested.ts:30
Parameters
Section titled “Parameters”ClassAccessorDecoratorTarget<object, any>
context
Section titled “context”ClassAccessorDecoratorContext
Returns
Section titled “Returns”void | ClassAccessorDecoratorResult<object, any>
Call Signature
Section titled “Call Signature”nested(
value,context):any
Defined in: nested.ts:30
Parameters
Section titled “Parameters”undefined
context
Section titled “context”ClassFieldDecoratorContext<object, any>
Returns
Section titled “Returns”any
Properties
Section titled “Properties”hoist:
PropertyDecorator<object> &ClassGetterDecorator<object,any> &ClassAccessorDecorator<object,any> &ClassFieldDecorator<object,any> =createNestedHoist
Defined in: nested.ts:49
Function
Annotation for nested objects that should be hoisted to the parent object
When using hoist mode:
- Nested objects are treated as part of the parent object
- Changes and errors from nested objects appear on the parent
Remarks
Section titled “Remarks”- Multiple hoisted keys within the same inheritance chain are not allowed
Example
Section titled “Example”@nested.hoist @observable private list: Sample[] = [];// Key path for "list.0.value" becomes "0.value"