All Projects → dwyl → Learn Redux

dwyl / Learn Redux

Licence: gpl-2.0
💥 Comprehensive Notes for Learning (how to use) Redux to manage state in your Web/Mobile (React.js) Apps.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Learn Redux

Learn Elm Architecture In Javascript
🦄 Learn how to build web apps using the Elm Architecture in "vanilla" JavaScript (step-by-step TDD tutorial)!
Stars: ✭ 173 (-60.86%)
Mutual labels:  tutorial, howto, elm-architecture
Espressif
all espressif stuff will committed here
Stars: ✭ 477 (+7.92%)
Mutual labels:  tutorial, howto
Reactnativecodereuseexample
Shows how to organize your code to reuse it as much as possible between Web, iOS and Android
Stars: ✭ 41 (-90.72%)
Mutual labels:  tutorial, howto
Learn Elm
🌈 discover the beautiful programming language that makes front-end web apps a joy to build and maintain!
Stars: ✭ 432 (-2.26%)
Mutual labels:  tutorial, elm-architecture
Phoenix Liveview Counter Tutorial
🤯 beginners tutorial building a real time counter in Phoenix 1.5.5 + LiveView 0.14.7 ⚡️
Stars: ✭ 115 (-73.98%)
Mutual labels:  tutorial, howto
Learn To Send Email Via Google Script Html No Server
📧 An Example of using an HTML form (e.g: "Contact Us" on a website) to send Email without a Backend Server (using a Google Script) perfect for static websites that need to collect data.
Stars: ✭ 2,718 (+514.93%)
Mutual labels:  tutorial, howto
Phoenix Ecto Append Only Log Example
📝 A step-by-step example/tutorial showing how to build a Phoenix (Elixir) App where all data is immutable (append only). Precursor to Blockchain, IPFS or Solid!
Stars: ✭ 58 (-86.88%)
Mutual labels:  tutorial, howto
An Idiots Guide To Installing Arch On A Lenovo Carbon X1 Gen 6
so you wanted to install arch huh
Stars: ✭ 165 (-62.67%)
Mutual labels:  tutorial, howto
Golang For Nodejs Developers
Examples of Golang compared to Node.js for learning
Stars: ✭ 2,698 (+510.41%)
Mutual labels:  tutorial, howto
Javascript Todo List Tutorial
✅ A step-by-step complete beginner example/tutorial for building a Todo List App (TodoMVC) from scratch in JavaScript following Test Driven Development (TDD) best practice. 🌱
Stars: ✭ 212 (-52.04%)
Mutual labels:  tutorial, elm-architecture
Avenging
MVP pattern example on Android: no Dagger or RxJava example
Stars: ✭ 279 (-36.88%)
Mutual labels:  tutorial, howto
Code search
Code For Medium Article: "How To Create Natural Language Semantic Search for Arbitrary Objects With Deep Learning"
Stars: ✭ 436 (-1.36%)
Mutual labels:  tutorial
Dellxps15 9550 Osx
Tutorial for a full working Mac OS (10.11 up to 11.0) enviroment on the Dell XPS 15 (9550)
Stars: ✭ 428 (-3.17%)
Mutual labels:  tutorial
Vue Tutorial
🎃 Some of the vue-tutorial - 《Vue学习笔记》
Stars: ✭ 426 (-3.62%)
Mutual labels:  tutorial
Codeparkshare
Python初学者(零基础学习Python、Python入门)书籍、视频、资料、社区推荐
Stars: ✭ 4,193 (+848.64%)
Mutual labels:  tutorial
Web Design In 4 Minutes
Learn the basics of web design in 4 minutes
Stars: ✭ 4,186 (+847.06%)
Mutual labels:  tutorial
Surfboard
Surfboard is a delightful onboarding framework for iOS.
Stars: ✭ 434 (-1.81%)
Mutual labels:  tutorial
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (-4.98%)
Mutual labels:  tutorial
Youtube React
A Youtube clone built in React, Redux, Redux-saga
Stars: ✭ 421 (-4.75%)
Mutual labels:  tutorial
Vex tutorial
📑 A collection of code snippets and examples showing syntax and capabilities of VEX language inside SideFX Houdini
Stars: ✭ 439 (-0.68%)
Mutual labels:  tutorial

learn-redux-header

Learn Redux

Redux simplifies writing well-structured, predictable, testable & maintainable JavaScript Web Applications.

Note: this guide is aimed at people who already have "intermediate" JavaScript experience. e.g. you have already built a couple of small apps without using a framework and/or have used an older more complex library such as Angular, Ember, Backbone or Flux. If you are just starting out on your web programming journey, we recommend you checkout: https://github.com/dwyl/start-here#javascript first and then come back here!
Bookmark/Star this GitHub repository so you don't forget where it is!

Why?

xkcd code quality

JavaScript web applications can become messy if they don't have a clear organisation from the beginning.

Redux is an elegant way to structure your JavaScript web applications.

Having built many web applications over the past few years using all the most popular frameworks/libraries, we were delighted to discover Redux's refreshingly simple approach.

While there is an initial learning curve we feel the simplicity of the single store (snapshot of your app's state) and applying changes to your app by dispatching succinct functional actions offers a significant benefit over other ways of organising your code.

Please, don't take our word for it, skim through the notes we have made and always decide for yourself.

What?

Redux1 borrows the reducer pattern from Elm Architecture which simplifies writing web apps.
If you have never heard of Elm, don't worry, you don't need to go read another doc before you can understand this... Just keep reading and (hopefully) everything will become clear.

If anything is unclear, please tell us where you are stuck so we can help! Join the chat at https://gitter.im/dwyl/chat

Three Principals

Redux is based on three principals.
see: http://redux.js.org/docs/introduction/ThreePrinciples.html

1. Single Source of Truth

The state of your whole application is stored in a single object tree; the "Store".
This makes it much easier to keep track of the "State" of your application at any time and roll back to any previous state.

If its not intermediately obvious why this is a good thing, we urge you to have faith and keep reading...

2. State is Read-Only ("Immutable")

Instead of directly updating data in the store, we describe the update as a function which gets applied to the existing store and returns a new version.

See: https://en.wikipedia.org/wiki/Immutable_object

3. Changes are made Using Pure Functions

To change the state tree we use "actions" called "reducers", these are simple functions which perform a single action.


tl;dr

Read more about JavaScript's Reduce (Array method): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
and how to reduce an array of Objects: http://stackoverflow.com/questions/5732043/javascript-reduce-on-array-of-objects
understanding these two things will help you grasp why Redux is so simple.

You will see this abbreviated/codified as (state, action) => state
to understand what this means, watch: youtu.be/xsSnOQynTHs?t=15m51s

How?

Learn Where Redux Got It's Best Ideas From!

Redux "takes cues from" (i.e. takes all it's best ideas/features from) Elm. redux-borrows-elm
So... by learning The Elm Architecture, you will intrinsically understand Redux
which will help you learn/develop React apps.

We wrote a complete beginner's step-by-step introduction to The Elm Architecture for JavaScript developers:
github.com/dwyl/learn-elm-architecture-in-javascript

If after you've learned Redux and built a couple of React Apps, you decide you want to discover where all the best ideas in the React ecosystem came from, checkout: github.com/dwyl/learn-elm

Learn from the Creator of Redux!

The fastest way to learn Redux is to watch the Introductory Video Tutorials recoded by Dan Abramov (the Creator of Redux).
The videos are broken down into "bite size" chunks which are easily digestible. Total viewing time for the videos is 66 minutes

We have made a set of comprehensive notes/transcriptions on the videos, these are in: egghead.io_video_tutorial_notes.md

We recommend keeping the notes open in a distinct window/browser while you are watching the videos; you can go a lot faster because all the sample code is included and if for any reason you do not understand what Dan is saying you have the notes to refer to.

learn-redux-video-notes-side-by-side

Please give feedback and suggest improvements by creating issues on GitHub: https://github.com/dwyl/learn-redux/issues Thanks!


Background Reading / Watching / Listening

Architecture

If you are building a React-based app you will most likely be using react-router to manage the routing of your client-side app ... React-Router manages an important piece of your application state: the URL. If you are using redux, you want your app state to fully represent your UI; if you snapshotted the app state, you should be able to load it up later and see the same thing.

Size (Matters)

At the time of writing, the minified version of Redux is 5.4kb which is even smaller when GZipped!

Frequently Asked Questions (FAQ)

(Do I Need to use) React ?

Short Answer: No, Redux does not depend on or require you to use React; the two are separate and can be learned/used independently.

Longer Answer: While many Redux apps and tutorials use React, Redux is totally separate from React. Dan's EggHead Video Tutorials do feature React heavily from Lesson 8 onwards.

React is a good fit for rendering views in a Redux-based app, however there are many other great alternative component-based virtual-DOM-enabled view rendering libraries (#mouth-full) that work really well with Redux; e.g: https://github.com/dekujs/deku

Considering that React is the fastest growing "view" (DOM Rendering) library of 2015 and the pace of its' adoption looks set to continue in 2016 ... so it won't hurt you to know how to use React.

We've made some notes to help you get started learning React: https://github.com/dwyl/learn-react

You can/should use Redux to organise your application and optionally use React to render your views.

(Should I use) Immutable.js ?

Short Answer: Not Yet!

Longer Answer: The convention in Redux apps is for the state to be immutable this makes your app far more predictable because any/all changes to the state have to be done via an action.

Immutable.js makes the data structures in your application state more efficient (in larger apps) however, while you are learning Redux we suggest you ignore immutable.js as you will have more than enough to master for now.

Once you have published your first app using Redux, come back to immutable.js to appreciate how it makes large apps run faster. As Lee Byron, the creator of Immutable.js states, for small apps without much change in state, adding Immutable.js will actually make your app perform worse!

If you want to understand why using Immutable.js can be a good thing in large apps, watch Lee Byron's intro to Immutable

Todo: pull requests welcomed!

  • [ ] Explain why Unidirectional Data Flow is this "better" than bi-directional e.g: Angular.js

Kudos to Fellow DWYLers

Props to Rafe for telling us about Redux and Elm: https://github.com/rjmk/reducks before it was cool
Thanks to Milo for his fantastic demo/example: https://github.com/bananaoomarang/isomorphic-redux
(which he has painstakingly kept up-to-date with the latest Redux/React versions!)
and love to Niki & Jack for their enthusiasm and patience while explaining it all to us ...

Thanks for Learning with Us!

If you found our notes useful, please share them with others by starring this repo and/or re-tweeting:

dan_abramov_retweeted

https://twitter.com/dwylhq/status/687703493264732160

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].