Download the PHP package arefshojaei/redux without Composer
On this page you can find all versions of the php package arefshojaei/redux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arefshojaei/redux
More information about arefshojaei/redux
Files in arefshojaei/redux
Informations about the package redux
Redux - State Manger
Installation
Using Composer
Using Git
Guide
Store : State or Container as Global data
Action : An Event to do something
Reducer : A Function to update state by Action
Middleware : A Function to call before Reducer for doing something
Apply Middlewares : A Function to get all Middleawres and apply in Store
Combine Reducers : Combine all reducers to get an Array with key & value
An Example of Counter App
Create Action to fire an Event
- Increment count
- Decrement count
- Reset count
Create Reducer to update State
- Increment count
- Decrement count
- Reset count
Note : when you calling an Action , you should know to get an Array of key & value like this
Create Store by Reducer
Use the Store in project
Subscribe the Store as Logger for changing State value
Create Middleware to log the Store & Action
Note: Middleware vs Subscriber
Middleware can log Store, Action and call next Middleware of Reducer by the Action!
Subscriber can be like Logger to get changing State value from Store!