When it comes to if statements it is possible to refactor this code
(This is just an example and does not refer to the "real" code)
if(person === 'customer' || person === 'employee' || person === 'other')
to
if(person === ('customer' || 'employee' || 'other'))
Currently I have an object called state
containing 3 boolean properties. I want to show an overlay if at least one property returns true
. My current solution is this
showOverlay: state => state.isNavigating || state.isHttpRequesting || state.isProcessing
and I'm asking if there is a way to clean it up. Pseudo code would be
showOverlay: state => (isNavigating || isHttpRequesting || isProcessing) of state
I know there is not a big gain out of it, but it would remove all the state. ...
parts.