Skip to content

Bind

Properties

MODEL_SYMBOL Read Only

luau
Bind.MODEL_SYMBOL: any

Functions

applyLayoutOrder

luau
Bind.applyLayoutOrder(child: Instance, order: number): number

model

luau
Bind.model<T>(node: Graph.Node<T>): T

Wraps a reactive node for two-way binding. Assigning Flux.model(node) to a property (or attribute) drives the Instance from the node AND writes the node back whenever the user changes that property, the terse equivalent of assigning the node and repeating it under _EVENT. Only sound for properties that fire a changed signal (e.g. TextBox.Text).

Open Documentation

children

luau
Bind.children<T>(node: Graph.Node<T>, parent: Instance, layoutOrder: number?): () -> ()

Reactively parents the node's value (a child Instance or an array of them) under parent, swapping in the new set and unparenting the old whenever the node updates. layoutOrder is the starting LayoutOrder, auto-assigned to each child that still has the default 0. Returns a disconnect that severs the binding and clears the parented children.

Open Documentation

listen

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

Registers fn to run on each update of the node, with RBXScriptSignal:Connect semantics: each invocation runs on its own thread (via task.spawn), so callbacks may yield freely. Returns an unsubscribe. For synchronous reactive observation, use an effect instead.

Open Documentation

from

luau
Bind.from<T>(node: Graph.Node<T>, instance: Instance, property: string, isAttribute: boolean?)

Drives the node's value from a property or attribute on a Roblox Instance: seeds the current value and keeps it in sync via the instance's changed signal. Returns the node and a disconnect.

Open Documentation

Parameters

  • property: The property or attribute name; a leading $ marks it an attribute when isAttribute is nil.
  • isAttribute: Forces attribute (true) or property (false) lookup, bypassing the $ convention.

node

luau
Bind.node<T>(obj: (() -> T) | T, effectOrProperty: boolean? | string?): Graph.Node<T>

The core constructor behind Flux(...): wraps a static value or a computation in a new node, or (when obj is a Roblox Instance) binds a new node from one of its properties or attributes. A function obj becomes a computed, or an effect when effectOrProperty is true.

Open Documentation

on

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

Builds an explicit-dependency reaction: it tracks only deps (a single node/function/value or an array of them) and runs fn untracked whenever one changes, so reads inside fn never become dependencies. Wrap it in a computed or effect; fn receives the current input, the previous input, and its own previous result. Set defer to skip the first run and react only to subsequent changes.

Open Documentation

Parameters

  • deps: The dependency, or array of dependencies, to react to.
  • fn: The reaction, run untracked, receiving (input, prevInput, prevResult).
  • defer: Skip the initial run, firing only on later changes.

to

luau
Bind.to<T>(node: Graph.Node<T>, instance: Instance, property: string, isAttribute: boolean?)

Binds the node's value to a property or attribute on a Roblox Instance: writes the current value now and on every update. Returns an unbind that detaches this binding without affecting other bindings on the same instance.

Open Documentation

Parameters

  • property: The property or attribute name to write.
  • isAttribute: When true, writes a Roblox attribute via SetAttribute; otherwise sets the property directly.