Back to home

LinksInstalling ReselectBasic Implementation
Reselect Quick And Dirty main image

Reselect Quick And Dirty

Quick and dirty implementation of reselect. This assumes you already have the requirements for Redux installed and in operation.

This link below is a great reference for indepth if you need more than a friendly reminder.

Dan Parker - Medium article

Installing Reselect

1 yarn install reselect

Basic Implementation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Reducer file import { createSelector } from "reselect"; /* Creating the Selector in reducer file */ const getElementsUi = (state) => state.sidebarReducer.elementsUi; export const getElementsUiState = createSelector( [getElementsUi], (elementsUi) => elementsUi ); // In file calling mapStateToProps const mapStateToProps = (state) => ({ elementsUi: reducers.getElementsUiState(state), }); const mapDispatchToProps = (dispatch) => ({ dispatch: dispatch }); export default connect(mapStateToProps, mapDispatchToProps)(Component);

Dennis O'Keeffe

@dennisokeeffe92
  • Melbourne, Australia

Hi, I am a professional Software Engineer. Formerly of Culture Amp, UsabilityHub, Present Company and NightGuru.
I am currently working on workingoutloud.dev, Den Dribbles and LandPad .

Related articles


1,200+ PEOPLE ALREADY JOINED ❤️️

Get fresh posts + news direct to your inbox.

No spam. We only send you relevant content.