Skip to content

DeepReadonly

type DeepReadonly<T> = mapped

Deeply-immutable version of T.

Recursively marks every property (and nested object property) as readonly. State retrieved from FlareRequest.state.require is always wrapped in DeepReadonly to guarantee that request-scoped state cannot be mutated after it is set.

State values are stored as frozen snapshots. Keep state values as plain data: primitives, arrays, and plain objects. Store mutable resources in an injected service instead.

Learn: Reading state

Last updated: