Socket
Socket
Sign inDemoInstall

redux-user-timing

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-user-timing

User Timing middleware for Redux


Version published
Maintainers
1
Weekly downloads
650
increased by22.18%

Weekly downloads

Readme

Source

redux-user-timing npm version Coverage Status CircleCI

User Timing middleware for profiling redux application

Introduction

Measuring performance is crucial for optimizing the application. Using with User Timing API, You can inspect performance about each dispatched redux action. For more details, check out Carl Vitullo's Blog: Performance Profiling a Redux App.

Performance Analysis Example in Chrome DevTools

Installation

$ npm i redux-user-timing

Alternatively, using yarn:

$ yarn add redux-user-timing

Then enable redux-user-timing with applyMiddleware()

import { createStore, applyMiddleware } from 'redux';
import userTiming from 'redux-user-timing';
import rootReducer from './reducers';

const store = createStore(rootReducer, applyMiddleware(userTiming));

Please, use this middleware only for development environment.

  • configureStore.js
import { createStore, applyMiddleware } from 'redux';
import userTiming from 'redux-user-timing';
import rootReducer from './reducers';

const configureStore = initialState => {
  const middlewares = [
    /* Some other middlewares */
  ];

  if (process.env.NODE_ENV !== 'production') {
    // Recommend to add redux-user-timing as a last middleware.
    middlewares.push(userTiming);
  }

  const store = createStore(
    rootReducer,
    initialState,
    applyMiddleware(...middlewares),
  );

  return store;
};

export default configureStore;

Thanks

This idea is inspired by clarkbw. and thanks for Carl Vitullo about kind blog explanation.

License

MIT © Taehwan Noh

Keywords

FAQs

Last updated on 31 Jan 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc