Skip to content

Instantly share code, notes, and snippets.

@smashercosmo
smashercosmo / logger.js
Last active April 17, 2019 13:06
Batch actions logger
import createLogger from 'redux-logger';
const actionTransformer = action => {
if (action.type === 'BATCHING_REDUCER.BATCH') {
action.payload.type = action.payload.reduce((result, next) => {
const prefix = result ? result + ' => ' : '';
return prefix + next.type;
}, '');
return action.payload;