@anton.matosov/rodux

1.0.0 • Public • Published

Rodux

A state management library for Roblox Lua inspired by Redux.
 

Installation

Method 1: Model File (Roblox Studio)

  • Download the rbxmx 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 lib 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.

Readme

Keywords

Package Sidebar

Install

npm i @anton.matosov/rodux

Weekly Downloads

0

Version

1.0.0

License

Apache-2.0

Unpacked Size

69.3 kB

Total Files

46

Last publish

Collaborators

  • anton.matosov