项目
在 GitHub 查看
Roblox/rodux
关于
一个适用于 Roblox Lua、受 Redux 启发的状态管理库。
开发工具实测星标增长
- 24小时
- 0
- 7天
- -2
- 15天
- -2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Rodux
A state management library for Roblox Lua inspired by Redux.
Installation
Method 1: Model File (Roblox Studio)
- Download the
rbxmmodel 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
srcdirectory 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.
探索相关项目
加载中…