Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Redux Made Easy with Rematch
  • Table Of Contents Toc
  • Feedback & Rating feedback
Redux Made Easy with Rematch

Redux Made Easy with Rematch

By : Moreno
5 (4)
close
close
Redux Made Easy with Rematch

Redux Made Easy with Rematch

5 (4)
By: Moreno

Overview of this book

Rematch is Redux best practices without the boilerplate. This book is an easy-to-read guide for anyone who wants to get started with Redux, and for those who are already using it and want to improve their codebase. Complete with hands-on tutorials, projects, and self-assessment questions, this easy-to-follow guide will take you from the simplest through to the most complex layers of Rematch. You’ll learn how to migrate from Redux, and write plugins to set up a fully tested store by integrating it with vanilla JavaScript, React, and React Native. You'll then build a real-world application from scratch with the power of Rematch and its plugins. As you advance, you’ll see how plugins extend Rematch functionalities, understanding how they work and help to create a maintainable project. Finally, you'll analyze the future of Rematch and how the frontend ecosystem is becoming easier to use and maintain with alternatives to Redux. By the end of this book, you'll be able to have total control of the application state and use Rematch to manage its scalability with simplicity.
Table of Contents (18 chapters)
close
close
1
Section 1: Rematch Essentials
In Progress | 0 / 1 sections completed | 0%
Free Chapter
2
Chapter 1: Why Redux? An Introduction to Redux Architecture
In Progress | 0 / 6 sections completed | 0%
3
Chapter 2: Why Rematch over Redux? An Introduction to Rematch Architecture
In Progress | 0 / 5 sections completed | 0%
6
Section 2: Building Real-World Web Apps with Rematch
In Progress | 0 / 1 sections completed | 0%
7
Chapter 5: React with Rematch – The Best Couple – Part I
In Progress | 0 / 5 sections completed | 0%
8
Chapter 6: React with Rematch – The Best Couple – Part II
In Progress | 0 / 5 sections completed | 0%
11
Section 3: Diving Deeper into Rematch
In Progress | 0 / 1 sections completed | 0%
12
Chapter 9: Composable Plugins – Create Your First Plugin
In Progress | 0 / 7 sections completed | 0%
16
Chapter 13: Conclusion
In Progress | 0 / 6 sections completed | 0%
17
Other Books You May Enjoy
In Progress | 0 / 2 sections completed | 0%

Migrating dispatch actions to effects

In our to-do app, we had four actions:

  • Adding a task
  • Removing a task
  • Toggle completed
  • Clear completed

Let's look at each one in more detail.

Adding a task

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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY