Skip to content

πŸ”₯ A redux middleware is inject marker to performance profile.

License

Notifications You must be signed in to change notification settings

MaxMEllon/redux-action-timing-middleware

Folders and files

NameName
Last commit message
Last commit date
Nov 22, 2018
Oct 11, 2018
Oct 17, 2019
Oct 11, 2018
Oct 11, 2018
Jan 2, 2019
Oct 12, 2020
Oct 17, 2019
Jun 21, 2021
Oct 4, 2020
Aug 24, 2022

Repository files navigation

redux-action-timing-middleware

Add marker of redux-action to User Timing in profile.

Installation

$ npm i --save-dev redux-action-timing-middleware
# or
$ yarn add --dev redux-action-timing-middleware

Usage

import { applyMiddleware, compose, createStore } from "redux";
import actionTiming from "redux-action-timing-middleware"

const createReduxStore = (reducer, initialState) => {
  const middlewares = [
    // Please put top in middleware list.
    actionTiming(),

    middlewareA,
    middlewareB
  ]

  return createStore(
    reducer,
    initialState,
    compose(applyMiddleware(...middlewares))
  )
}

export default createReduxStore

Option

  • actionTiming(enable: boolean = true): void

Please set NODE_ENV to arguments, if you use only development

const middlewares = [
  // Please put top in middleware list.
  actionTiming(process.env.NODE_ENV === 'development'),

  middlewareA,
  middlewareB
]

LICENSE

Licensed under the MIT License.

About

πŸ”₯ A redux middleware is inject marker to performance profile.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published