Migrating from Redux
Since Kea is built on Redux, it is very easy to connect it to an existing Redux application.
#
Using Redux actionsYou can use regular Redux actions in reducers and listeners. Just use their type
as a key:
#
Reading non-Kea stateYou can use regular selectors in your selectors
blocks:
In listeners you have access to the store
object:
#
Converting Redux actions and selectors into Kea actions and valuesYou may pull in data from any part of the Redux state tree with connect
.
Instead of passing a logic to fetch from, pass a selector:
Similarly, use an object of action creators and select the ones you need:
note
See the Kea API docs for all options for connect.
#
Using Kea actions and selectors elsewhereIf the redux-only part of your app needs access to some values or actions from kea logic stores, you can import them like so:
See the logic API docs for more details.
Next steps
- Check out how to Write Plugins for Kea.