Skip to content

Instantly share code, notes, and snippets.

@alexesDev
Created February 16, 2018 08:26
Show Gist options
  • Select an option

  • Save alexesDev/31086e30a0f37b2db228e330aa4d0bcb to your computer and use it in GitHub Desktop.

Select an option

Save alexesDev/31086e30a0f37b2db228e330aa4d0bcb to your computer and use it in GitHub Desktop.
var { createStructuredSelector } = require("reselect")
const ide = {
tabs: [],
activeTab: null,
sidebarInitialSize: 100,
sidebarTab: 'schema',
contents: {},
};
const selector = createStructuredSelector({
tabs: state => state.tabs,
activeTab: state => state.activeTab,
sidebarInitialSize: state => state.sidebarInitialSize,
sidebarTab: state => state.sidebarTab,
});
console.log(selector(ide) === selector({ ...ide, contents: { test: 1 } }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment