Redux Tutorial - Learn Redux from Scratch

Redux Tutorial - Learn Redux from Scratch

My Ultimate Redux Course

In this course, the instructor will teach everything needed to build real complex applications with Redux. The course covers functional programming principles, writing clean code, designing complex stores, middleware, calling APIs, testing and integrating with React.

What is Redux?

  • Redux is a state management library for JavaScript applications.
  • It can be used with React, Angular or even vanilla JavaScript.
  • It centralizes application state in a single repository called the store.
  • This makes data flow transparent and predictable across different parts of the UI.

Benefits of Using Redux

  • Centralizing application state makes data flow transparent and predictable.
  • Debugging becomes easier using tools like Redux Dev Tools.
  • Synchronizing data across different parts of the UI becomes simpler.
  • Understanding how data changes in our applications becomes easier.

Food Delivery Application Example

  • A food delivery application built with React and Redux is shown as an example.
  • The left side shows food categories such as soups and salads that can be selected to add items to the shopping cart on the right side.
  • As items are added or removed from the cart, the total price and number of items are updated in real-time.

Introduction to Redux

In this section, the instructor introduces Redux and explains its benefits. He also discusses some of the challenges associated with using Redux.

What is Redux?

  • Redux is a state management library for JavaScript applications.
  • It makes state changes predictable and transparent.
  • It centralizes application state, making it accessible by all parts of the UI.

Benefits of Using Redux

  • Time travel debugging allows developers to go back to previous actions and restore the UI in that state.
  • The entire application state can be saved in a single file and reloaded later.
  • Paid State can be cached or preserved, allowing for faster load times and improved user experience.
  • Implementing undo or redo features becomes easier.

Challenges Associated with Using Redux

  • Redux code tends to be verbose due to boilerplate code required to get things done.
  • Indirection and complexity are introduced into code due to functional programming principles used by Redux.

When Should You Use Redux?

In this section, the instructor discusses when it's appropriate to use Redux in an application.

Understanding Your Problem

  • Before deciding whether or not to use Redux, you need to understand what problem you're trying to solve and what constraints you have.
  • There is no one-size-fits-all solution in software engineering.

When Not To Use Redux

  • If you're on a tight budget or building a small-to-medium-sized app with simple UI and data flow, then using Redux may complicate things without providing much value.

[CUTOFF_LIMIT]

Video description

Redux tutorial - Learn redux from scratch. 🚀Get the full Redux course: https://codewithmosh.com/p/ultimate-redux 👍Subscribe for more tutorials like this: https://goo.gl/6PYaGF Download the starter project: https://bit.ly/2RWgf32 CONNECT WITH ME My Courses: http://codewithmosh.com My Blog: http://programmingwithmosh.com My Facebook: https://www.facebook.com/programmingwithmosh My Twitter: https://twitter.com/moshhamedani You might also like: React Tutorial for Beginners: https://youtu.be/Ke90Tje7VS0 JavaScript Tutorial for Beginners: https://youtu.be/W6NZfCO5SIk Angular Tutorial for Beginners: https://youtu.be/k5E2AVpwsko TABLE OF CONTENT 0:00:00 Introduction 0:01:02 What is Redux? 0:03:20 Pros and Cons of Redux 0:08:49 Is Redux for You? 0:11:18 Setting Up the Development Environment 0:13:07 Course Structure 0:15:32 Function Programming 0:15:59 What is Functional Programming? 0:17:25 Functions as First-Class Citizens 0:20:33 Higher-order Functions 0:22:06 Functional Composition 0:25:45 Composing and Piping 0:28:08 Currying 0:34:17 Pure Functions 0:37:08 Immutability 0:41:22 Updating Objects 0:45:56 Updating Arrays 0:49:51 Enforcing Immutability 0:50:56 Immutable.js 0:54:36 Immer 0:57:30 Redux Intro 0:57:55 Redux Architecture 1:02:58 Your First Redux Application 1:04:43 Designing the Store 1:06:10 Defining the Actions 1:09:37 Creating a Reducer 1:15:50 Creating the Store 1:17:16 Dispatching Actions 1:20:02 Subscribing to the Store 1:22:10 Action Types 1:26:03 Action Creators 1:29:01 Exercise 1:29:18 Solution

Redux Tutorial - Learn Redux from Scratch | YouTube Video Summary | Video Highlight