Forest Logo
search
package_2

ro-pinia

By @faizdzn

Roblox

Mirrored from Wally

RoPinia

GitHub license CI [image: Get it on Creator Store] [image: Wally (external link)]

A Pinia state management library ported into Roblox, bringing the simplicity and developer experience of Pinia to Roblox. If you're already familiar with Pinia, this library provides a familiar approach to creating stores, managing reactive state, and organizing application logic.

Example Usage

init.client.luau:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local pinia = require(ReplicatedStorage.RoPinia)

-- example of stores
local myStore = pinia.store.defineStore("myStore", {
    state = function()
        return {
            hello = "World",
            angka = 10
        };
    end,
    getters = {
        multipleAngka = function(state)
            return state.angka.value * 2
        end
    },
    actions = {
        helloWorld = function(self)
            print(`Hello {self.hello.value}`)
        end,
        sumWithN = function(self, n)
            self.angka.value += n
        end
    }
})

print("My Store")
print(myStore)
print(myStore.angka.value)
print(myStore.multipleAngka.value)

myStore.sumWithN(1)
myStore.multipleAngka:recompute()
print(myStore.angka.value)
print(myStore.multipleAngka.value)

Check our official examples in ./example (Rojo)

Contributors

Made with contrib.rocks.

Donate

If RoPinia is useful to you, consider supporting its development! Your support helps us maintain the project, improve existing features, fix bugs, and continue building useful open-source tools for the community. Every contribution, whether it's a sponsorship, donation, or simply sharing the project, is greatly appreciated.

Patreon

Package Details

Install command (Click to copy)


Version

0.1.1

License

MIT

check_circle

Safe for commercial use

Automated license review — not legal advice.