Bind
Functions
model
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.
isModel
Bind.isModel(value: unknown): booleanReturns true when value is a Flux.model wrapper.
modelNode
Bind.modelNode(value: unknown): Graph.Node<any>?Returns the underlying node from a Flux.model wrapper, or nil if value is not a model.
local node = Flux.modelNode(props.value)
if node then
node:set(text)
endlisten
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.
property
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.
local text = Flux.property(textBox, "Text")
local health = Flux.property(character, "$Health")
local isEnemy = Flux.property(character, "#Enemy")on
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.