Sha256: b2eefe2d8a39d0a64963165a419f806791e0fff2306926d2e4a78d865eaff54e

Contents?: true

Size: 677 Bytes

Versions: 18

Compression:

Stored size: 677 Bytes

Contents

/* eslint no-console: 0 */

// This logger should be configured not to run in a production environment.
// See https://github.com/petehunt/webpack-howto#6-feature-flags for how you might turn this
// off for production.
export default function logger({ getState }) {
  return next => action => {
    console.log('will dispatch', action);

    // Call the next dispatch method in the middleware chain.
    const result = next(action);

    const immutableState = getState();

    console.log('state after dispatch', JSON.stringify(immutableState));

    // This will likely be the action itself, unless
    // a middleware further in chain changed it.
    return result;
  };
}

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
react_on_rails-5.2.0 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-5.1.1 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-5.1.0 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-5.0.0 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-5.0.0.rc.1 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.3 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.2 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.1 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.0 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.0.beta.3 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.0.beta.2 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-4.0.0.beta.1 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.6 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.5 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.4 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.3 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.2 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
react_on_rails-3.0.1 lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js