Skip to content

Bind ​

Functions ​

model ​

luau
Bind.model<N>(node: N): Graph.Unwrap<N>

Wraps a reactive node for two-way binding on an Instance property, attribute, or tag. Updates the instance from node and writes changes back to node when the instance fires its changed signal.

Open Documentation

isModel ​

luau
Bind.isModel(value: unknown): boolean

Returns true when value is a Flux.model wrapper.

Open Documentation

modelNode ​

luau
Bind.modelNode(value: unknown): Graph.Node<any>?

Returns the underlying node from a Flux.model wrapper, or nil if value is not a model.

luau
local node = Flux.modelNode(props.value)
if node then
	node:set(text)
end

Open Documentation

listen ​

luau
Bind.listen<T>(node: Graph.Node<T>, fn: (value: T) -> ()): () -> ()

Subscribes fn to updates of node with RBXScriptSignal:Connect semantics and returns an unsubscribe function. Fires on each flush after node changes, spawning fn(value) on its own thread via task.spawn so callbacks may yield freely.

Open Documentation

property ​

luau
Bind.property<I, K>(instance: I & Instance, property: K | "Name"): Graph.Node<Type.PropertyType<I, K>>

Creates a node mirroring an Instance property, an attribute ($Name or _attr_Name), or a CollectionService tag (#Tag or _tag_Tag). Disconnects automatically when the node or its owning scope is destroyed.

luau
local text = Flux.property(textBox, "Text")
local health = Flux.property(character, "$Health")
local isEnemy = Flux.property(character, "#Enemy")

Open Documentation

on ​

luau
Bind.on<D, R>(deps: any, fn: (input: any, prevInput: any?, prevResult: R?) -> R, defer: boolean?): (prevResult: R?) -> R?

Wraps fn so a computed or effect tracks only deps and runs fn(input, prevInput, prevResult) untracked. Pass defer = true to skip the initial run and fire only when deps change.

Open Documentation