This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redux_log = []; | |
const errorLogMiddleware = (store) => (next) => (action) => { | |
const type = (action && action.type) || 'unknown action'; | |
if ( type === 'LOG_ERROR' ) { | |
const log_str = redux_log.join(' -> '); | |
const error_str = (action && action.payload && action.payload.error) || 'Redux Error'; | |
console.error(error_str + ': ' + log_str); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const get = function(state, arrayPath, defaultValue) { | |
if (arrayPath.length === 1) { | |
return state.get(arrayPath[0], defaultValue); | |
} else { | |
return state.getIn(arrayPath, defaultValue); | |
} | |
} |
OlderNewer