af83/chouette-core

View on GitHub
app/packs/src/helpers/middlewares.js

Summary

Maintainability
A
0 mins
Test Coverage
import { applyMiddleware } from 'redux'
import logger from 'redux-logger';
import { isDev } from './env'

export default function applyMiddlewareWrapper(...middlewares) {
    const list = [
        ...isDev ? [logger] : [],
        ...middlewares
    ]

    return applyMiddleware(...list)
}