[Library] Val - A simple, lightweight state management library

Documentation GitHub Latest Release MIT License

> Installation instructions <

About

Val is a simple, lightweight state management library for Roblox & Luau. Inspired by reactive programming, Val allows you to observe values so that you can automate processes for value changes.

Why Val?

  • Zero dependencies (source code is just a single file!)
  • Easy/simple API that minimizes verbosity
  • Focused on general-purpose state reactivity rather than UI exclusively

Features

You can go over these features in-depth in the documentation.

  • Computeds
  • Observers
  • Scopes
  • Batched updates
  • Memory management
  • Built-in arithmetic & string operations
  • Strict type-safety
  • (Near) full customization of states
8 Likes

I just want to say thank you for sharing this.
I’ve been looking for something like this. Simple yet powerful.

Update v0.2.0

  • Add math operation methods: min, max, clamp, abs, floor, ceil, round, snap, lerp
  • Add chaining support for Val:set
  • Add alias Val.T<T> equal to Val.Val<T> for external scripts
  • Add alias Val:Destroy() equal to Val:die() for better compatibility with cleanup libraries like Janitor

Update v0.3.0

  • Fix operation methods not updating observers
  • Add forceSet parameter to all operation methods except for min and max (due to compatibility issues)