FluxLazy fine-grained reactivity for Luau
Be lazy. Do more. Go fast.
Be lazy. Do more. Go fast.
Flux exploits Luau's type checker to its absolute limit, if you're going to be lazy, your editor should do the heavy lifting. The moment you declare an instance like a TextLabel or a Frame, you get zero-guesswork autocomplete for every valid property, event, and expected type.
Flux cuts boilerplate with __call metamethods and full operator overloading on every reactive node, so your keystrokes can be just as lazy as the engine under the hood. This means you can forget :get() and :set(1), just use count() to read and count(1) to write. Arithmetic, comparison, and concatenation operators automatically subscribe, so reactive expressions read like the plain Luau around them.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Flux = require(ReplicatedStorage.Flux)
local new = Flux.new
local count = Flux(0)
new "ScreenGui" {
Parent = playerGui,
new "TextButton" {
Size = UDim2.fromOffset(200, 50),
Text = function() return `Clicks: {count}` end,
Activated = function() count(count + 1) end,
},
}Most reactive libraries lean on topological sorting, dirty-checking, or a virtual DOM, all of which carry real overhead on the Luau VM. Flux avoids that overhead by being uncompromisingly lazy. It evaluates absolutely nothing until a value is explicitly observed, ensuring that only the exact work a change strictly requires is ever calculated. No over-fetching, no premature rendering, and no wasted CPU cycles; just maximum performance through pure, optimal laziness.