create-immutable-selector
v1.0.0
Published
Immutable.js reselect selector
Downloads
4
Maintainers
Readme
create-immutable-selector
createImmutableSelector
is a customized version of reselect's createSelector with Immutable.is as equality check.
import createImmutableSelector from "create-immutable-selector";
const shopItemsSelector = state => state.getIn(["shop", "items"]);
const taxPercentSelector = state => state.getIn(["shop", "taxPercent"]);
const subtotalSelector = createImmutableSelector(shopItemsSelector, items =>
items.reduce((acc, item) => acc + item.value, 0)
);