際際滷

際際滷Share a Scribd company logo
Trim Your Redux Boilerplate
with Redux Cornell
Hello!
I am Eyal Eizenberg
Team Leader at Wix
Before we start...
do you Redux?
Dan Abramov
Creator of Redux
Why do I have to touch three files
to get a simple feature working?
You Might Not Need Redux
Why indeed!
Reduxs Boilerplate
Adding a single boolean attribute which
needs to be toggled requires A LOT of code
Reduxs Boilerplate
About 10 lines just
to toggle a boolean
Constant
Selector
Reducer
Import everything
across multiple files
Actions
Trim your Redux Boilerplate with Redux Cornell
Is there a pattern here?
How can we fix this?
Lets rewind for a minute
Ruby On Rails
relies on the
convention over configuration and DRY concepts
I used to develop with...
Software design paradigm used by
frameworks that attempt to decrease the
number of decisions that a developer using
the framework is required to make, without
necessarily losing flexibility
Convention Over
Configuration
Convention Over
Configuration
In other words You only need to
specify unconventional aspects
of your application
A model called User
 Will be in app/models/user.rb
 UsersController in users_controller.rb
 The table in the DB will be called users
 Getters & setters according to the models properties
 users_helper.rb
 app/views/users/index.html
 Url will be /users/:id
 Customize if needed (but not recommended)
Pros
 Reduces boilerplate
 Easy to follow once you know it
 All apps are alike
 Customizable
Cons
 Seems like voodoo
 You have to know the convention
 Difficult for noobs
 Customizable
Can we bring a similar
concept into Redux?
Trim your Redux Boilerplate with Redux Cornell
Chris Cornell
1964 - 2017
 Chief architect of the 1990s
grunge movement
 33 year long career
 Struggled with depression
One of the best singers of all time
~800,000
Suicides per year world wide
1 every 40 seconds!
About 16,000,000 attempted suicides
Trim your Redux Boilerplate with Redux Cornell
Get Help!
 Talk to family/friend/professional
 www.eran.org.il
 www.talkspace.com
 www.betterhelp.com
github.com/wix/redux-cornell
OSS library meant to reduce Reduxs biolerplate
so you can focus on what matters most - your app!
 Tiny, with zero dependencies
 Brings Convention Over Configuration into Javascript
 Allows building complete apps without things like
reducers, selectors, and consts
 Easy to customize
Makes Redux great again!
The initialState
object is
analyzed by
each keys
initial value
How does it work?
 Selectors, action creators,
constants are generated
 A Super Reducer handles
all relevant actions
 Does not bloat your app!
Provide the
main function
with an
initialState
object
Selectors
getUsersAreVisible
Action
Creators
toggleUsersAreVisible
Super
Reducer
Will toggle
users  areVisible
to true/false
initialState = {
users: {
areVisible: false
}
}
 https://eyaleizenberg.github.io/imdb_list/index.html
 https://github.com/eyaleizenberg/imdb_list
 Sample app which uses Redux Cornell
 Fetches data, toggles, expands, text field...
 Created with react-create-app
No
Reducers
Consts
Action-Creators
Selectors
Enough talk!
Lets see some code!
Trim your Redux Boilerplate with Redux Cornell
Wrap Up
 Write less code, focus on your app
 Logic inferred from data structure
 Convention Over Configuration
 Whats next?
Thanks!
Any questions?
@eyaleizenberg
eyal-eizenberg
eyaleizenberg
@eyaleizenberg

More Related Content

Similar to Trim your Redux Boilerplate with Redux Cornell (20)

JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JSFestUA
Enterprise UI/UX - design as code
Enterprise UI/UX - design as codeEnterprise UI/UX - design as code
Enterprise UI/UX - design as code
Works Applications
The REAL Angular Keynote
The REAL Angular KeynoteThe REAL Angular Keynote
The REAL Angular Keynote
Lukas Ruebbelke
Microservices: Redundancy=Maintainability
Microservices: Redundancy=MaintainabilityMicroservices: Redundancy=Maintainability
Microservices: Redundancy=Maintainability
Eberhard Wolff
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tips
Bill Buchan
SEng522Seminar hardware/software codesign.ppt
SEng522Seminar hardware/software codesign.pptSEng522Seminar hardware/software codesign.ppt
SEng522Seminar hardware/software codesign.ppt
BEVARAVASUDEVAAP1813
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday introMarco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Kiratech
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
Jose Luis Soria
Container Days
Container DaysContainer Days
Container Days
Patrick Mizer
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
DynamicInfraDays
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
Katarzyna Hoffman
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
Cloud 66
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
Xebia IT Architects
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Thomas Pierrain
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
IT Arena
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4jAdobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Neo4j
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Ahmed Adel
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application grows
Carolina Karklis
GC @ jmaghreb2014
GC @ jmaghreb2014GC @ jmaghreb2014
GC @ jmaghreb2014
Ivan Krylov
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JSFestUA
Enterprise UI/UX - design as code
Enterprise UI/UX - design as codeEnterprise UI/UX - design as code
Enterprise UI/UX - design as code
Works Applications
The REAL Angular Keynote
The REAL Angular KeynoteThe REAL Angular Keynote
The REAL Angular Keynote
Lukas Ruebbelke
Microservices: Redundancy=Maintainability
Microservices: Redundancy=MaintainabilityMicroservices: Redundancy=Maintainability
Microservices: Redundancy=Maintainability
Eberhard Wolff
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tips
Bill Buchan
SEng522Seminar hardware/software codesign.ppt
SEng522Seminar hardware/software codesign.pptSEng522Seminar hardware/software codesign.ppt
SEng522Seminar hardware/software codesign.ppt
BEVARAVASUDEVAAP1813
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday introMarco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Marco bizzantino Microsoft-Docker Meetup #4 Docker bday intro
Kiratech
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
COBOLizer - Plain Concepts - Microsoft WE ALM partner summit 2011
Jose Luis Soria
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
DynamicInfraDays
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
Katarzyna Hoffman
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
Cloud 66
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Thomas Pierrain
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
Microservices: Redundancy = Maintainability! (Eberhard Wolff Technology Stream)
IT Arena
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4jAdobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Adobe Behance Scales to Millions of Users at Lower TCO with Neo4j
Neo4j
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Ahmed Adel
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application grows
Carolina Karklis
GC @ jmaghreb2014
GC @ jmaghreb2014GC @ jmaghreb2014
GC @ jmaghreb2014
Ivan Krylov

Recently uploaded (20)

Data Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - WebinarData Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - Webinar
OnePlan Solutions
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
SE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.pptSE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.ppt
theworldimagine985
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
AI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee SupportAI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee Support
AutomationEdge Technologies
LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio: Preprocessing, ...
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio:  Preprocessing, ...AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio:  Preprocessing, ...
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio: Preprocessing, ...
Alluxio, Inc.
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Yann-Ga谷l Gu辿h辿neuc
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
Minitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free DownloadMinitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free Download
v3r2eptd2q
AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]
haroonsaeed605
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
Data Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - WebinarData Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - Webinar
OnePlan Solutions
Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0Consequences and Principles of Software Quality v1.0
Consequences and Principles of Software Quality v1.0
Yann-Ga谷l Gu辿h辿neuc
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
SE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.pptSE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.ppt
theworldimagine985
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio: Preprocessing, ...
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio:  Preprocessing, ...AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio:  Preprocessing, ...
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio: Preprocessing, ...
Alluxio, Inc.
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Projects Panama, Valhalla, and Babylon: Java is the New Python v0.9
Yann-Ga谷l Gu辿h辿neuc
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
Minitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free DownloadMinitool Partition Wizard Crack Free Download
Minitool Partition Wizard Crack Free Download
v3r2eptd2q
AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]AVG Antivirus Crack With Free version Download 2025 [Latest]
AVG Antivirus Crack With Free version Download 2025 [Latest]
haroonsaeed605
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech

Trim your Redux Boilerplate with Redux Cornell