Documentation / @zerotal/flow / index / transient
Variable: transient
consttransient: (value,context) =>void
Defined in: flow/src/decorators.ts:386
Marks a field as transient — excluded from the snapshot entirely.
Parameters
value
unknown
context
ClassFieldDecoratorContext
Returns
void
Remarks
Unlike @computed (which is derived and re-runs each render), a transient field is ordinary
server-side state that simply never crosses the wire and is not persisted between requests:
it holds its default value at the start of each render and is invisible to the client. Use it
for server-only scratch state (caches, handles, injected services) that must not be serialized.
Applies only to a field; a getter/accessor is rejected at runtime.
Example
class Report extends Component {
// Server-only handle — never serialized to the client.
@transient private db!: DatabaseConnection;
}