Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / modelable

Variable: modelable

const modelable: (value, context) => void

Defined in: flow/src/decorators.ts:636

Marks a child-component prop as two-way bound to the parent (parent↔child).

Parameters

value

unknown

context

ClassFieldDecoratorContext

Returns

void

Remarks

A modelable prop is reactive (the parent pushes new values in on re-render) AND syncs back: value={this.x} on a child component binds the parent's x to the child's modelable prop in both directions. A modelable prop is implicitly reactive (it registers as both). Mirrors Livewire's #[Modelable]. Applies to a field only.

Example

class TextField extends Component {
  // Parent binds with `value={this.query}`; edits here flow back to the parent.
  @modelable value = "";
}