Skip to content

Flux ​

A reactive state management library that makes it easy to create dynamic user interfaces and game logic

Types ​

Action type ​

luau
type Action = {
	callback: (Instance) -> (),
}

Properties ​

Clean ​

luau
Flux.Clean: Type.Symbol

A symbol for defining cleanup in Flux.edit and Flux.new

Attribute ​

luau
Flux.Attribute: Type.Symbol

A symbol for defining attributes in Flux.edit and Flux.new

Event ​

luau
Flux.Event: Type.Symbol

A symbol for defining events in Flux.edit and Flux.new

Color Module ​

luau
Flux.Color: Color

Interpolate Module ​

luau
Flux.Interpolate: Interpolate

State Module ​

luau
Flux.State: State

Type Module ​

luau
Flux.Type: Type

Functions ​

deferUpdates ​

luau
Flux.deferUpdates(value: boolean?)

Sets the update defer behaviour, defaults to false to improve performance

cleanup ​

luau
Flux.cleanup(obj: any)

action ​

luau
Flux.action(callback: (Instance) -> ()): Action

Creates an action to run logic on an instance

edit ​

luau
Flux.edit<T>(instance: T & Instance, properties: Type.Dict<any>): T

Edits an existing Instance with Flux state bindings and other properties

new ​

luau
Flux.new(classOrInstance: string | Instance): (Type.Dict<any>) -> Instance

Creates a new Instance with Flux state bindings and other properties

isState from State ​

luau
Flux.isState(object: any): boolean

Checks if an object is a Flux state

raw from State ​

luau
Flux.raw<T>(object: T): any

Gets the raw value of a Flux state or returns the input if it's not a state

rawVariadic from State ​

luau
Flux.rawVariadic(...: any): ...any

Gets the raw values of multiple Flux states or non-state inputs

compute from State ​

luau
Flux.compute<T>(computation: () -> T): State<T>

Creates a computed state, automatically tracking dependencies

state from State ​

luau
Flux.state<T>(initialValue: T? | Instance? | State<T>?, property: string?): State<T>

Creates a new Flux state with an initial value

spring from Spring ​

luau
Flux.spring<T>(goal: State.Stateful<T>, speed: State.Stateful<number>?, damping: State.Stateful<number>?): State.State<T>

Creates a new Flux spring state

tween from Tween ​

luau
Flux.tween<T>(state: T | Type.Function | State.State<T>, tweenInfo: State.Stateful<TweenInfo>): State.State<T>

Creates a new Flux tween state