
Redux Made Easy with Rematch
By :

In our to-do app, we had four actions:
Let's look at each one in more detail.
The following code snippet shows how to add a task to our store:
store.dispatch({ type: "ADD_TODO", title: inputValue });
With Rematch, this type of dispatch works out of the box, but it isn't recommended to use because it isn't type-safe and isn't very readable.
In Rematch, we adopt an alternative strategy of what Redux offers initially with the dispatch
method. When Rematch initialises the store through the init()
function or we add a new model using the store.addModel()
function, we iterate over all the models and we create shortcuts for each reducer and effect for each model of our store. This means that we can access any reducer or effect of our store using direct access, such as...