The Redux Framework provides a set of modular blocks that send and receive data over the PubNub Data Stream Network and maintain the data in a Redux store that you define and own. You can add the building blocks to connect your defined Redux store to either a new or existing application.
Any UI framework that can interact with Redux can then interact with this data. In this architecture, your defined Redux store becomes the interface between your application and the PubNub Network, and your app benefits from Redux managing your app's state in a predictable way.
The modular building blocks fall into four component categories:
- Reducers define the type of data which will be stored in your Redux Store. Redux enforces the concept that the application state can be updated only by a reducer in response to actions.
- Basic Actions represent an event which has occurred which might have an impact on the data stored by your application. The Redux framework defines a standard set of basic actions for working with realtime data.
- Listeners wait for specific events, and create actions that can be responded to by other listeners or reducers.
- Commands interact with the PubNub API to perform actions on your PubNub server. When your app dispatches a command, the Redux framework begins a process chain that dispatches further actions to be processed by listeners and reducers.
How to Use
You can use any of the reducers, listeners, and commands out-of-the-box. And, if your app needs to work a specific way to interact with your own data, you can still benefit from the PubNub Redux framework by creating your own reducers, listeners, and commands to process the basic actions.