# @martini97/redux-log-slow-reducers

> Warn about slow reducers in your Redux app.

Latest version **0.0.5** (published 2019-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @martini97/redux-log-slow-reducers
pnpm add @martini97/redux-log-slow-reducers
yarn add @martini97/redux-log-slow-reducers
bun add @martini97/redux-log-slow-reducers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-12-22 |
| First published | 2019-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alessandro F. Martini |
| Maintainers | martini97 |
| Keywords | flux, flux-standard-action, fsa, middleware, react, react-native, redux, redux-middleware |

## Links

- npm: https://www.npmjs.com/package/@martini97/redux-log-slow-reducers
- Repository: https://github.com/martini97/redux-log-slow-reducers
- Homepage: https://github.com/martini97/redux-log-slow-reducers#readme
- Issues: https://github.com/martini97/redux-log-slow-reducers/issues
- npm.io page: https://npm.io/package/@martini97/redux-log-slow-reducers

## Dependencies (1)

- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.7.0

## Recent versions

- 0.0.5 (latest) — 2019-12-22
- 0.0.4 — 2019-12-21
- 0.0.1 — 2019-12-20

## README

[@martini79/redux-log-slow-reducers]()
===========================

[![license](https://img.shields.io/npm/l/redux-log-slow-reducers.svg?style=flat-square)](https://www.npmjs.com/package/redux-log-slow-reducers)
[![Build Status](https://travis-ci.org/martini97/redux-log-slow-reducers.svg?branch=master)](https://travis-ci.org/martini97/redux-log-slow-reducers)
[![Coverage Status](https://coveralls.io/repos/github/martini97/redux-log-slow-reducers/badge.svg?branch=master)](https://coveralls.io/github/martini97/redux-log-slow-reducers?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/03ddfad40ac1a8f39225/maintainability)](https://codeclimate.com/github/martini97/redux-log-slow-reducers/maintainability)

Warn about slow reducers in your [Redux](https://redux.js.org/) app.

Fork of [redux-log-slow-reducers](https://github.com/michaelcontento/redux-log-slow-reducers)

## Installation

```shell
npm install --save redux-log-slow-reducers
# or
yarn add @martini97/redux-log-slow-reducers
```

## Usage

```js

// Note: There is a optional second argument to logSlowReducers which allows you
//       to define how slow a reducer must be to trigger a warning (in ms) and
//       a predicate to decide whether or not to wrap the reducer functions. The
//       default value for threshold is 8ms, as this is half the time available
//       in one frame to run at 60fps. If you do not pass a predicate it will
//       always wrap the reducers.

import logSlowReducers from '@martini97/redux-log-slow-reducers';
import { createStore, combineReducers } from 'redux';

import * as reducers from './reducers';

const loggingReducers = logSlowReducers(
  reducers,
  { thresholdInMs: 10, predicate: () => process.env.NODE_ENV !== 'production' }
);
const store = createStore(combineReducers(loggingReducers));
```

## Contributing

This project uses [commitlint](https://commitlint.js.org/#/) to enforce commit
patterns, since it runs on CI there is no getting around that, so if you want to
avoid having your CI breaking, consider adding this to your `.git/hooks/commit-msg`:

```bash
ROOT=$(git rev-parse --show-toplevel)
NODE_BIN="$ROOT/node_modules/.bin"
COMMITLINT="$NODE_BIN/commitlint"

sed '/^# Please enter the commit message for your changes/,$d' $1 | $COMMITLINT
```

---
_Source: https://npm.io/package/@martini97/redux-log-slow-reducers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
