SlideShare a Scribd company logo
Olena Sovyn (@frontendgirl)
Webflow
Understanding Recompose
through examples
Olena Sovyn
(@frontendgirl)
! & !
❤
React

Redux
Lodash
React Storybook
functional programming
Olena Sovyn
(@frontendgirl)
Understanding
Recompose through
examples
Image source: https://szenandoah.deviantart.com/art/Wonderland-Logo-252210579
1 year ago . . .
How to make
complex
component to be
reusable ?
Data
Behaviour
UI
Reusable ???
HOC
(high order components)
HOC
changed: context
or/and props
Recompose
Data
Behaviour
UI
Recompose
HOC
Stateless component
Why should I
care about
Recompose ?
Image source: http://spacenews.com/spacexs-new-price-chart-illustrates-performance-cost-of-reusability/
Image source: https://whataboutjesus.com/jesus-is-the-only-way/
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
Dunning‒Kruger effectConfidence
Wisdom
first usage of
one of Recompose
HOCs
reading
Recompose

documentation
trying to use
Recompose on
practice
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
branch
lifecycle
renderComponent
renderNothing
toClass
mapProps
withProps
withPropsOnChange
defaultProps
renameProp
renameProps
flattenProp
withState
withHandlers
withStateHandlers
withReducer
shouldUpdate
pure
onlyUpdateForKeys
onlyUpdateForPropTypes
withContext
getContext
Props
State Performance
Other
Context
Recompose

HOCs
branch
lifecycle
renderComponent
renderNothing
toClass
mapProps
withProps
withPropsOnChange
defaultProps
renameProp
renameProps
flattenProp
withState
withHandlers
withStateHandlers
withReducer
shouldUpdate
pure
onlyUpdateForKeys
onlyUpdateForPropTypes
withContext
getContext
Props
State Performance
Other
Context
Recompose

HOCs
< 280
Reusability
lifecycle
Image source: https://www.codevoila.com/post/57/reactjs-tutorial-react-component-lifecycle
timeExamples
setDisplayName
toClass
lifecycle
getContext
withContext
onlyUpdateForPropTypes
onlyUpdateForKeys
setStatic
setPropTypes
componentFromStream
setObservableConfig
createEventHandlerWithConfig
createEventHandler
mapPropsStreamWithConfig
mapPropsStream
componentFromStreamWithConfig
compose
isClassComponent
getDisplayName
wrapDisplayName
shallowEqual
createSink
componentFromProp
nest
hoistStatics
mapProps
withProps
withHandlers
withPropsOnChange
renameProps
defaultProps
renameProp
withState
renderComponent
renderNothing
withReducer
withStateHandlers
shouldUpdate
pure
branch
flattenProp
Any
takeaways ?
Even if you are not
directly
contributing to
libraries you have
still a lot to share3
Awesome
Recompose
Make ideas clearly
stand out in your
examples, no
matter how
complex they are2
Useful
Example
Complex
example
Simple example
Even if something
wasn’t clear from
the first time
there is always
another way1
Django Girls Kyiv #1
Image source: https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/
Lin Clark works
Image source: https://twitter.com/kosamari/status/859958929484337152
Codedoodles by Mariko Kosaka
Code
Example
Input Output
Even if something
wasn’t clear from
the first time
there is always
another way1
Olena Sovyn "Understanding Recompose through examples"

More Related Content

Similar to Olena Sovyn "Understanding Recompose through examples"

JavaScript-based Visualization in R
JavaScript-based Visualization in RJavaScript-based Visualization in R
JavaScript-based Visualization in R
Fan Li
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
David Krmpotic
 

Similar to Olena Sovyn "Understanding Recompose through examples" (18)

JavaScript-based Visualization in R
JavaScript-based Visualization in RJavaScript-based Visualization in R
JavaScript-based Visualization in R
 
React HOCs, Context and Observables
React HOCs, Context and ObservablesReact HOCs, Context and Observables
React HOCs, Context and Observables
 
Spot the Dog: An overview of semantic retrieval of unannotated images in the ...
Spot the Dog: An overview of semantic retrieval of unannotated images in the ...Spot the Dog: An overview of semantic retrieval of unannotated images in the ...
Spot the Dog: An overview of semantic retrieval of unannotated images in the ...
 
Jruby
JrubyJruby
Jruby
 
JPA 스터디 Week2 - Object Relational Mapping
JPA 스터디 Week2 - Object Relational MappingJPA 스터디 Week2 - Object Relational Mapping
JPA 스터디 Week2 - Object Relational Mapping
 
Corso su ReactJS
Corso su ReactJSCorso su ReactJS
Corso su ReactJS
 
JavaScript Reactivity - Angular Meetup Dhaka
JavaScript Reactivity - Angular Meetup DhakaJavaScript Reactivity - Angular Meetup Dhaka
JavaScript Reactivity - Angular Meetup Dhaka
 
Hybrid Web Applications
Hybrid Web ApplicationsHybrid Web Applications
Hybrid Web Applications
 
WEB IMAGE RE-RANKING USING QUERY-SPECIFIC SEMANTIC SIGNATURES
WEB IMAGE RE-RANKING USING QUERY-SPECIFIC SEMANTIC SIGNATURESWEB IMAGE RE-RANKING USING QUERY-SPECIFIC SEMANTIC SIGNATURES
WEB IMAGE RE-RANKING USING QUERY-SPECIFIC SEMANTIC SIGNATURES
 
A mysterious journey to MVP world - Viber Android Meetup 2018
A mysterious journey to MVP world - Viber Android Meetup 2018A mysterious journey to MVP world - Viber Android Meetup 2018
A mysterious journey to MVP world - Viber Android Meetup 2018
 
Inverting Dependencies
Inverting DependenciesInverting Dependencies
Inverting Dependencies
 
Practical Responsive Images : from Breaking Borders
Practical Responsive Images : from Breaking BordersPractical Responsive Images : from Breaking Borders
Practical Responsive Images : from Breaking Borders
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
The content manager loves the tree
The content manager loves the treeThe content manager loves the tree
The content manager loves the tree
 
Performance and UX
Performance and UXPerformance and UX
Performance and UX
 
April 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk DrupalApril 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk Drupal
 
30 days-of-react-ebook-fullstackio
30 days-of-react-ebook-fullstackio30 days-of-react-ebook-fullstackio
30 days-of-react-ebook-fullstackio
 

More from Fwdays

More from Fwdays (20)

"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh"What I learned through reverse engineering", Yuri Artiukh
"What I learned through reverse engineering", Yuri Artiukh
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov"Micro frontends: Unbelievably true life story", Dmytro Pavlov
"Micro frontends: Unbelievably true life story", Dmytro Pavlov
 
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
"Objects validation and comparison using runtime types (io-ts)", Oleksandr Suhak
 
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
"JavaScript. Standard evolution, when nobody cares", Roman Savitskyi
 
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 

Olena Sovyn "Understanding Recompose through examples"