Skip to content
forked from Roblox/rodux

A state management library for Roblox Lua inspired by Redux

License

Notifications You must be signed in to change notification settings

jakebball/rodux

This branch is 5 commits ahead of, 8 commits behind Roblox/rodux:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d5b5acb · Oct 12, 2022
Jul 18, 2022
Jul 14, 2022
Mar 17, 2021
Oct 12, 2022
Nov 2, 2021
Nov 2, 2021
Nov 28, 2017
Oct 7, 2022
Mar 16, 2018
Mar 17, 2021
Jan 21, 2020
Jul 18, 2022
Nov 2, 2021
Nov 7, 2017
Nov 1, 2021
Jan 21, 2020
Oct 7, 2022
Apr 21, 2022
Mar 23, 2018
Jul 18, 2022
Nov 1, 2021
Jun 13, 2022
Nov 1, 2021
Jul 18, 2022

Repository files navigation

Rodux

A state management library for Roblox Lua inspired by Redux.
 

Installation

Method 1: Model File (Roblox Studio)

  • Download the rbxm model file attached to the latest release from the GitHub releases page.
  • Insert the model into Studio into a place like ReplicatedStorage

Method 2: Filesystem

  • Copy the src directory into your codebase
  • Rename the folder to Rodux
  • Use a plugin like Rojo to sync the files into a place

Usage

Rodux works just like Redux's base API.

See the official Rodux Documentation for more details.

local Rodux = require(script.Parent.Rodux)

local function reducer(state, action)
	state = state or {
		frobulations = 0,
	}

	if action.type == "frobulate" then
		return {
			frobulations = state.frobulations + 1,
		}
	end

	return state
end

local store = Rodux.Store.new(reducer)

store:getState() -- { frobulations = 0 }

store:dispatch({
	type = "frobulate",
})

store:getState() -- { frobulations = 1 }

Contributing

Contributions are welcome! See CONTRIBUTING.md for information.

License

Rodux is available under the Apache 2.0 license. See LICENSE for details.

About

A state management library for Roblox Lua inspired by Redux

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%