Skip to content

Wrap

Types

wrappedType type function

luau
type function wrappedType(obj: type, node: type)

Wrapped type

luau
type Wrapped<T> = wrappedType<T, Graph.Node<any>>

Functions

wrap

luau
Wrap.wrap<T>(obj: T): Wrapped<T>

Makes a table reactive in place: every plain leaf becomes a node, recursing into nested plain tables and leaving existing nodes and metatabled tables (a class instance, a proxy) untouched. The table is returned with its type preserved, so wrap({ hp = 100 }).hp() is a number. A non-table value returns a single node holding it.

Open Documentation

props

luau
Wrap.props<T, O>(defaults: T, overrides: O?): Wrapped<T>

Builds a component props table from a defaults schema and the caller's overrides, keeping only keys declared in defaults (unknown override keys are left for instance hydration) and passing the merged result through wrap. Neither input is mutated: nested plain tables are deep-copied per call, so instances never share state through the schema or a reused override table.

Open Documentation