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
6
Section 2: Building Real-World Web Apps with Rematch
11
Section 3: Diving Deeper into Rematch

TypeScript with React and Rematch

Thanks to TypeScript, we're now able to know which state is accessible, possibly undefined, or even doesn't exist. We just need to tweak some of the functions that we were already using, such as useDispatch or useSelector.

Taking src/components/Cart as an example, let's check how Rematch makes it extremely easy to power our React views with TypeScript IntelliSense:

import type { RootState, Dispatch } from "../../store";
export const Cart = () => {
  const dispatch = useDispatch<Dispatch>();
  const quantityById = useSelector(
    (rootState: RootState) => rootState.cart.quantityById
  );
  const cartProducts = useSelector(store.select.cart.  getCartProducts);
  const totalPrice = useSelector(store.select.cart.total);

As we saw previously, TypeScript generics are important for Rematch and also for React and Redux, since we can...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Redux Made Easy with Rematch
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

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

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon