Reselect: Disable reselect method caching in dev mode?

Created on 18 Dec 2017  路  2Comments  路  Source: reduxjs/reselect

Hello, while developing I would like to disable reselect and just hit the regular non cached method. Is this possible?

Most helpful comment

Thanks @AlexGalays, worked great. Not sure why this is not the default behavior though.

All 2 comments

This is best done in user land; Something like :

// utils/createSelector.js

import { createSelector as defaultCreateSelector, createSelectorCreator } from 'reselect'

export const createSelector = process.env.NODE_ENV === 'production'
  ? defaultCreateSelector
  : createSelectorCreator(func => func)

and always use that local version.

Didn't test that code but you get the idea :)

Thanks @AlexGalays, worked great. Not sure why this is not the default behavior though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jwoudenberg picture jwoudenberg  路  3Comments

clementdevos picture clementdevos  路  4Comments

vjau picture vjau  路  5Comments

binarykitchen picture binarykitchen  路  3Comments

jEnbuska picture jEnbuska  路  6Comments