Documentation / @zerotal/flow / index / locked
Variable: locked
constlocked: (value,context) =>void
Defined in: flow/src/decorators.ts:459
Marks a field as exposed but read-only client-side: it is included in the snapshot (the client
can read/render it) but the client cannot mutate it via flow:model.
Parameters
value
unknown
context
ClassFieldDecoratorContext
Returns
void
Remarks
@locked implies @expose (it registers the prop as exposed) while additionally flagging it
as locked, so client-originated writes are rejected. Use it for server-authoritative state the
UI displays but must not change directly — the value only moves via server actions. Applies to
a field only.
Example
class Profile extends Component {
// Client renders it, but cannot bind it with flow:model.
@locked role = "member";
}