{"id":"lopi-py/rodux-hooks","name":"rodux-hooks","scope":"lopi-py","platform":"roblox","description":"React hooks for Rodux","version":"0.2.13","latest":"0.2.13","versions":["0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.1.10","0.1.11","0.1.12","0.1.13","0.2.13"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{"core-packages/react":{"version":"^17.0.1-rc.19","alias":"React"}},"integrity":"1a27282a54791be3d45c0c197db1d4c7b77853d773e027c14a0b36c87001b4ed","likes":0,"downloads":0,"install":"forest install lopi-py/rodux-hooks","url":"https://forest.dev/p/roblox/lopi-py/rodux-hooks","files":"https://api.forest.dev/ai/package/roblox/lopi-py/rodux-hooks/files","readme":"# Rodux Hooks\r\nThis project takes inspiration from [solarhorizon/rodux-hooks](https://github.com/solarhorizon/rodux-hooks) in order to make it work with [Roact17](https://github.com/grilme99/corepackages#roact17).\r\n\r\n## Setup\r\n```lua\r\nlocal RoduxHooks = require(path.to.RoduxHooks)\r\nlocal store = require(path.to.store)\r\n\r\nlocal useStore = RoduxHooks.useStore\r\nlocal useSelector = RoduxHooks.useSelector\r\nlocal useDispatch = RoduxHooks.useDispatch\r\n```\r\n\r\n## Api\r\n```lua\r\nuseStore(): Store\r\n```\r\n\r\n```lua\r\nuseSelector<S, T>(selector: (S) -> T, equalityFn: ((T, T) -> boolean)?): T\r\n```\r\n\r\n```lua\r\nuseDispatch(): (action: AnyAction) -> ()\r\n```\r\n\r\n## Example\r\n```lua\r\nlocal function MyComponent()\r\n    local counter = useSelector(function(state: store.State)\r\n        return state.counter\r\n    end)\r\n\r\n    return e(\"TextLabel\", {\r\n        AnchorPoint = Vector2.new(0.5, 0.5),\r\n        Position = UDim2.fromScale(0.5, 0.5),\r\n        Size = UDim2.fromOffset(200, 100),\r\n        Text = `Count: {counter}`,\r\n    })\r\nend\r\n```\r\n","readmeBorrowedFrom":{"version":"0.1.7","source":"wally"},"readmeTruncated":false}