Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Serverless Web Applications with React and Firebase

You're reading from   Serverless Web Applications with React and Firebase Develop real-time applications for web and mobile platforms

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788477413
Length 284 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Harmeet Singh Harmeet Singh
Author Profile Icon Harmeet Singh
Harmeet Singh
Mayur Tanna Mayur Tanna
Author Profile Icon Mayur Tanna
Mayur Tanna
Arrow right icon
View More author details
Toc

Basics of Redux

Redux is quite simple, so don't be afraid by just looking at the fancy terms such as Reducers, Actions, and such. We will go through the basic building blocks of Redux application, and you will also feel the same.

Actions

As we saw at the beginning of the chapter, an action is nothing but a plain JavaScript object that describes what has happened. To change the state is to emit an action that describes what has happened. Also, for store, actions are only the source of truth or information.

Here's an example action creator.

Each action type should be defined as a constant:

const fetchSeats = rows => ({
type: GET_SEATS,
rows
})

The type of an action describes the kind of the action that has...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime