SlideShare a Scribd company logo
1 of 37
aOS Luxembourg
6 décembre 2018
Introduce Redux in your SPFx solution
Yannick Borghmans
#SPSSTHLM, September 14th, 2019
yannickborghmans.com
Linkedin.com/in/yborghmans
@yborghmans
Yannick Borghmans
Office 365/SharePoint Technical Lead @Ventigrate
SPS Belgium
SPS Dakar
SPS The Netherlands
SPS Leicester
SPS Casablanca
SPS Paris
SPS Madrid
aOS Luxembourg
Office 365 Dev Bootcamp
…
aOS Luxembourg
6 décembre 2018
What to expect?
Introduction React
What is Redux
Middleware
Tooling
React
React
React is a declarative, efficient, and flexible
JavaScript library for building user interfaces.
It lets you compose complex UIs from small and
isolated pieces of code called “components”
Fast!!!
React
Components
React
Components
Props
React
Components
Props
State
React
Props and State do similar things but are used in
different ways. The majority of your components
will probably be stateless.
Props are used to pass data from parent to child
or by the component itself. They are immutable
and thus will not be changed.
State is used for mutable data, or data that will
change. This is particularly useful for user input.
Think search bars for example. The user will type
in data and this will update what they see.
React
Props and State do similar things but are used in
different ways. The majority of your components
will probably be stateless.
Props are used to pass data from parent to child
or by the component itself. They are immutable
and thus will not be changed.
State is used for mutable data, or data that will
change. This is particularly useful for user input.
Think search bars for example. The user will type
in data and this will update what they see.
React
Props and State do similar things but are used in
different ways. The majority of your components
will probably be stateless.
Props are used to pass data from parent to child
or by the component itself. They are immutable
and thus will not be changed.
State is used for mutable data, or data that will
change. This is particularly useful for user input.
Think search bars for example. The user will type
in data and this will update what they see.
Demo
Building ‘simple’ React application
View
List
Item 2Item 1 Item 3
Form
Input
speaker
Input
title
Button
API
Async
Redux
Redux
Redux is a state container, it stores all of your
state in one place
The state is read only, the only way to change
state is to dispatch an action.
State can only be changed by pure functions or in
another term: Reducers. Redux Reducers take in
the previous state and an action object and
returns the next state.
Three
Principles
Single source of truth
State is read-only
Changes are made with pure functions
aOS Luxembourg
6 décembre 2018
What to do
in SPFx?
Add
• Actions
• Reducer
• Store
• Application State
‘Decouple’ components
Dispatch events
Demo
Converting to Redux
Middleware
Middleware
It provides a third-party extension point
between dispatching an action, and the moment
it reaches the reducer.
Demo
Use Middleware
Tooling
Redux DevTools Extension
• npm install --save-dev redux-devtools-extension
Demo
Key takeaways
Key takeaways
SMALL SPFX SOLUTION
=> NO REDUX
SPLIT UP ACTIONS USE DEVTOOLS PUT EVERYTHING IN
STATE
MIDDLEWARE FOR (SP)
API CALLS
Please visit our sponsors who made this day possible!
Thankyou!
Rate this session with
the event app
http://rate.spsstockholm.com

More Related Content

Similar to SPS Stockholm Introduce Redux in your SPFx solution

locotalk-whitepaper-2016
locotalk-whitepaper-2016locotalk-whitepaper-2016
locotalk-whitepaper-2016
Anthony Wijnen
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
farhan amjad
 

Similar to SPS Stockholm Introduce Redux in your SPFx solution (20)

an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to Redux
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
FluentD vs. Logstash
FluentD vs. LogstashFluentD vs. Logstash
FluentD vs. Logstash
 
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
 
React & Flux Workshop
React & Flux WorkshopReact & Flux Workshop
React & Flux Workshop
 
SharePoint Framework y React
SharePoint Framework y ReactSharePoint Framework y React
SharePoint Framework y React
 
Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS
 
locotalk-whitepaper-2016
locotalk-whitepaper-2016locotalk-whitepaper-2016
locotalk-whitepaper-2016
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
The Clean Architecture
The Clean ArchitectureThe Clean Architecture
The Clean Architecture
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
Comprehensive Guide to React Development 2022.pptx
Comprehensive Guide to React Development 2022.pptxComprehensive Guide to React Development 2022.pptx
Comprehensive Guide to React Development 2022.pptx
 
Олексій Пастухов, "Чи є життя без single-state management?"
Олексій Пастухов, "Чи є життя без single-state management?"Олексій Пастухов, "Чи є життя без single-state management?"
Олексій Пастухов, "Чи є життя без single-state management?"
 
Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)Managing Large Flask Applications On Google App Engine (GAE)
Managing Large Flask Applications On Google App Engine (GAE)
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
React native - Unleash the power of your device
React native - Unleash the power of your deviceReact native - Unleash the power of your device
React native - Unleash the power of your device
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android Montréal
 
Best Practices to Ace ReactJS Web Development!
Best Practices to Ace ReactJS Web Development!Best Practices to Ace ReactJS Web Development!
Best Practices to Ace ReactJS Web Development!
 
React
ReactReact
React
 
OOP ppt.pdf
OOP ppt.pdfOOP ppt.pdf
OOP ppt.pdf
 

More from Yannick Borghmans

Mastering sp fx in larger projects yannick borghmans
Mastering sp fx in larger projects   yannick borghmansMastering sp fx in larger projects   yannick borghmans
Mastering sp fx in larger projects yannick borghmans
Yannick Borghmans
 

More from Yannick Borghmans (7)

aOS Monaco - SPFx deployment
aOS Monaco - SPFx deploymentaOS Monaco - SPFx deployment
aOS Monaco - SPFx deployment
 
Mastering sp fx in larger projects yannick borghmans
Mastering sp fx in larger projects   yannick borghmansMastering sp fx in larger projects   yannick borghmans
Mastering sp fx in larger projects yannick borghmans
 
SPS Madrid - SPFx deployment
SPS Madrid - SPFx deploymentSPS Madrid - SPFx deployment
SPS Madrid - SPFx deployment
 
SPS Paris - SPFx deployment
SPS Paris - SPFx deploymentSPS Paris - SPFx deployment
SPS Paris - SPFx deployment
 
SPSCasablanca - SPFx Deployment
SPSCasablanca - SPFx DeploymentSPSCasablanca - SPFx Deployment
SPSCasablanca - SPFx Deployment
 
SPSNL - SPFx Deployment
SPSNL - SPFx DeploymentSPSNL - SPFx Deployment
SPSNL - SPFx Deployment
 
Biwug 20180410 - I developed a SharePoint Framework solution, what to do next...
Biwug 20180410 - I developed a SharePoint Framework solution, what to do next...Biwug 20180410 - I developed a SharePoint Framework solution, what to do next...
Biwug 20180410 - I developed a SharePoint Framework solution, what to do next...
 

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 

SPS Stockholm Introduce Redux in your SPFx solution

  • 1. aOS Luxembourg 6 décembre 2018 Introduce Redux in your SPFx solution Yannick Borghmans #SPSSTHLM, September 14th, 2019
  • 2.
  • 3. yannickborghmans.com Linkedin.com/in/yborghmans @yborghmans Yannick Borghmans Office 365/SharePoint Technical Lead @Ventigrate SPS Belgium SPS Dakar SPS The Netherlands SPS Leicester SPS Casablanca SPS Paris SPS Madrid aOS Luxembourg Office 365 Dev Bootcamp …
  • 4. aOS Luxembourg 6 décembre 2018 What to expect? Introduction React What is Redux Middleware Tooling
  • 6. React React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components” Fast!!!
  • 8.
  • 10.
  • 12.
  • 13. React Props and State do similar things but are used in different ways. The majority of your components will probably be stateless. Props are used to pass data from parent to child or by the component itself. They are immutable and thus will not be changed. State is used for mutable data, or data that will change. This is particularly useful for user input. Think search bars for example. The user will type in data and this will update what they see.
  • 14. React Props and State do similar things but are used in different ways. The majority of your components will probably be stateless. Props are used to pass data from parent to child or by the component itself. They are immutable and thus will not be changed. State is used for mutable data, or data that will change. This is particularly useful for user input. Think search bars for example. The user will type in data and this will update what they see.
  • 15. React Props and State do similar things but are used in different ways. The majority of your components will probably be stateless. Props are used to pass data from parent to child or by the component itself. They are immutable and thus will not be changed. State is used for mutable data, or data that will change. This is particularly useful for user input. Think search bars for example. The user will type in data and this will update what they see.
  • 16.
  • 17.
  • 19. View List Item 2Item 1 Item 3 Form Input speaker Input title Button API Async
  • 20. Redux
  • 21. Redux Redux is a state container, it stores all of your state in one place The state is read only, the only way to change state is to dispatch an action. State can only be changed by pure functions or in another term: Reducers. Redux Reducers take in the previous state and an action object and returns the next state.
  • 22. Three Principles Single source of truth State is read-only Changes are made with pure functions
  • 23.
  • 25. What to do in SPFx? Add • Actions • Reducer • Store • Application State ‘Decouple’ components Dispatch events
  • 28. Middleware It provides a third-party extension point between dispatching an action, and the moment it reaches the reducer.
  • 29.
  • 32. Redux DevTools Extension • npm install --save-dev redux-devtools-extension
  • 33. Demo
  • 35. Key takeaways SMALL SPFX SOLUTION => NO REDUX SPLIT UP ACTIONS USE DEVTOOLS PUT EVERYTHING IN STATE MIDDLEWARE FOR (SP) API CALLS
  • 36.
  • 37. Please visit our sponsors who made this day possible! Thankyou! Rate this session with the event app http://rate.spsstockholm.com

Editor's Notes

  1. React is a JavaScript library for building user interfaces. It is the view layer for web applications. At the heart of all React applications are components. A component is a self-contained module that renders some output. We can write interface elements like a button or an input field as a React component. Components are composable. A component might include one or more other components in its output. Broadly speaking, to write React apps we write React components that correspond to various interface elements. We then organize these components inside higher-level components which define the structure of our application. For example, take a form. A form might consist of many interface elements, like input fields, labels, or buttons. Each element inside the form can be written as a React component. We'd then write a higher-level component, the form component itself. The form component would specify the structure of the form and include each of these interface elements inside of it. Importantly, each component in a React app abides by strict data management principles. Complex, interactive user interfaces often involve complex data and application state. The surface area of React is limited and aimed at giving us the tools to be able to anticipate how our application will look with a given set of circumstances.
  2. Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components
  3. Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components
  4. Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components