Open renatomcamilio opened 3 years ago
I ran into this issue where NODE_ENV is always !== "production", because when running in the browser window won't be undefined.
NODE_ENV
!== "production"
window
undefined
Check the code below: https://github.com/jeffbski/redux-logic/blob/1034a3ecff5dc12d3fb82ed3386a86a89d3adab5/src/createLogic.js#L24
So, later on in the same file we reference it to decide whether to log warnings (using warnTimeout), and even in production builds we are seeing these logs: https://github.com/jeffbski/redux-logic/blob/1034a3ecff5dc12d3fb82ed3386a86a89d3adab5/src/createLogic.js#L188-L193
warnTimeout
I have a couple questions regarding the way we define NODE_ENV here:
typeof window === 'undefined'
@renatomcamilio Thanks for reaching out.
Regarding your questions:
When you create your logic, just set warnTimeout: 0 and this should silence all of those logs.
warnTimeout: 0
I ran into this issue where
NODE_ENV
is always!== "production"
, because when running in the browserwindow
won't beundefined
.Check the code below: https://github.com/jeffbski/redux-logic/blob/1034a3ecff5dc12d3fb82ed3386a86a89d3adab5/src/createLogic.js#L24
So, later on in the same file we reference it to decide whether to log warnings (using
warnTimeout
), and even in production builds we are seeing these logs: https://github.com/jeffbski/redux-logic/blob/1034a3ecff5dc12d3fb82ed3386a86a89d3adab5/src/createLogic.js#L188-L193I have a couple questions regarding the way we define
NODE_ENV
here:typeof window === 'undefined'
? Is this just meant for the build/babel step?NODE_ENV
. Do you have a suggestion how to approach this?