How to use the reselect/lib/index.createSelector function in reselect

To help you get started, we’ve selected a few reselect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github manusa / isotope-mail / client / src / selectors / folders.js View on Github external
import get from 'lodash/get';
import {selectedFolderId} from './application';
import {createSelector} from 'reselect/lib/index';

export const explodedItems = state => get(state, 'folders.explodedItems');

export const getSelectedFolder = createSelector(
  explodedItems,
  selectedFolderId,
  (resolvedExplodedItems, resolvedSelectedFolderId) => resolvedExplodedItems[resolvedSelectedFolderId]
);