Skip to content

Directive

Types

Node type

luau
type Node = Graph.Node<any>

Tag type

luau
type Tag = Node | string | (() -> string | { string })

tagValue type

luau
type tagValue = Tag | { Tag }

Functions

attr

luau
Directive.attr(attribute: { [string]: any } | string, value: any?): any

One-off form of the _ATTR directive: place Flux.attr("Name", value) or Flux.attr { Name = value } anywhere in the array portion of a property table to set or bind Roblox attributes on the Instance. Accepts the same values as _ATTR (static values, reactive nodes, functions, and Flux.model).

Open Documentation

event

luau
Directive.event(event: { [string]: any } | string, handler: ((...any) -> ()) | Node | nil): any

One-off form of the _EVENT directive: place Flux.event("Name", handler) or Flux.event { Name = handler } anywhere in the array portion of a property table to connect listeners or bind values from the Instance into nodes. Accepts the same values as _EVENT, including a nested _ATTR map for attribute-changed listeners.

Open Documentation

onDestroy

luau
Directive.onDestroy(...: any): any

One-off form of the _CLEAN directive: place Flux.onDestroy(...) anywhere in the array portion of a property table to tie extra teardown (functions, connections, instances, scopes, or arrays of these) to the Instance's Destroying lifetime. Distinct from Flux.cleanup, which registers a callback on the current reactive owner instead.

Open Documentation

ref

luau
Directive.ref(ref: ((Instance) -> any) | Node): any

One-off form of the _REF directive: place Flux.ref(nodeOrCallback) anywhere in the array portion of a property table to receive the built Instance. A node is set to the instance; a callback receives it and may return a cleanup value tied to the instance's lifetime.

Open Documentation

tag

luau
Directive.tag(...: tagValue): any

One-off form of the _TAG directive: place Flux.tag(...) anywhere in the array portion of a property table to manage CollectionService tags on the Instance. Each argument accepts the same values as _TAG: a string, a reactive node or function whose value is a tag or array of tags (diffed on change), or an array of any of these.

Open Documentation