Home › Overview › MainModule
Flux
A reactive state management library that makes it easy to create dynamic user interfaces and game logic
Types
Action type
type Action = {
callback: (Instance) -> (),
}Properties
Clean
Flux.Clean: Type.SymbolA symbol for defining cleanup in Flux.edit and Flux.new
Attribute
Flux.Attribute: Type.SymbolA symbol for defining attributes in Flux.edit and Flux.new
Event
Flux.Event: Type.SymbolA symbol for defining events in Flux.edit and Flux.new
Color Module
Flux.Color: ColorInterpolate Module
Flux.Interpolate: InterpolateState Module
Flux.State: StateType Module
Flux.Type: TypeFunctions
deferUpdates
Flux.deferUpdates(value: boolean?)Sets the update defer behaviour, defaults to false to improve performance
cleanup
Flux.cleanup(obj: any)action
Creates an action to run logic on an instance
edit
Edits an existing Instance with Flux state bindings and other properties
new
Creates a new Instance with Flux state bindings and other properties
isState from State
Flux.isState(object: any): booleanChecks if an object is a Flux state
raw from State
Flux.raw<T>(object: T): anyGets the raw value of a Flux state or returns the input if it's not a state
rawVariadic from State
Flux.rawVariadic(...: any): ...anyGets the raw values of multiple Flux states or non-state inputs
compute from State
Flux.compute<T>(computation: () -> T): State<T>Creates a computed state, automatically tracking dependencies
state from State
Creates a new Flux state with an initial value
spring from Spring
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
Flux.tween<T>(state: T | Type.Function | State.State<T>, tweenInfo: State.Stateful<TweenInfo>): State.State<T>Creates a new Flux tween state