Redux in Action by Marc Garreau Will Faurot

Redux in Action by Marc Garreau Will Faurot

Author:Marc Garreau Will Faurot
Language: eng
Format: mobi, epub
Publisher: Manning Publications
Published: 2018-05-22T13:30:21.719000+00:00


One of the biggest advantages of selectors is they allow you to store the minimal possible state representation in Redux. For example, there’s nothing stopping you from storing the list of filtered tasks directly in the store. Whenever the filter action is dispatched, you can apply the filter directly in the reducer and store the result in a key such as filteredTasks, and then pass that directly to React. You’d end up with a structure that looks something like the following listing.

Listing 7.2. filteredTasks persisted in Redux

{

tasks: [

{id: 1, title: 'foo'},

{id: 2, title: 'bar'},

],

filteredTasks: [

{id: 1, title: 'foo'},

],

searchText: 'foo',

}

Even an implementation like this hits two of your goals:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Deep Learning with Python by François Chollet(12607)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7796)
Grails in Action by Glen Smith Peter Ledbrook(7707)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6429)
Kotlin in Action by Dmitry Jemerov(5077)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3884)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3339)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(3095)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2878)
The Art Of Deception by Kevin Mitnick(2616)
Drugs Unlimited by Mike Power(2476)
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson(2392)
A Blueprint for Production-Ready Web Applications: Leverage industry best practices to create complete web apps with Python, TypeScript, and AWS by Dr. Philip Jones(2318)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
Writing for the Web: Creating Compelling Web Content Using Words, Pictures and Sound (Eva Spring's Library) by Lynda Felder(2270)
SEO 2018: Learn search engine optimization with smart internet marketing strategies by Adam Clarke(2197)
JavaScript by Example by S Dani Akash(2144)
DarkMarket by Misha Glenny(2088)
Wireless Hacking 101 by Karina Astudillo(2084)
Hands-On Cybersecurity with Blockchain by Rajneesh Gupta(2029)