Skip to content

Neura-Studios/roact-rodux

 
 

Repository files navigation

Roact-Rodux

A binding between Roact and Rodux.
 

Roact-Rodux is an ergonomic binding between Roact, a view library, and Rodux, a state management library.

It is the recommended way to use the two libraries together, and is similar in scope to react-redux, the equivalent library for React and Redux.

All documentation for Roact-Rodux is available on the official docs website. It includes:

Fork Changes

This fork requires you to pass in an array of store state keys as the first argument to RoactRodux.connect. This ensures that you have control over which bits of state trigger rerenders for your component.

Here's an example that shows how to link RoactRodux with a basic currency display:

--[[

Rodux store state:

{
	Coins = 50,
	Gems = 100,
	Inventory = {...},
	UserPreferences = {...}
}

]]

-- Connecting your component --
RoactRodux.connect({
    "Coins",
    "Gems"
}, function(state)
    return {
        coins = state.Coins,
        gems = state.Gems
    }
end, function(dispatch)
    return {
        ...
    }
end)(CurrencyDisplayComponent)

Contributing

Contributions to Roact-Rodux are welcome! Details are available in the contributing guide.

License

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


About

A connector between Roact and Rodux, similar to react-redux

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 98.2%
  • Shell 1.8%