# react-updating-hoc

> small HOC for implementing update on props changing

Latest version **2.3.1** (published 2020-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-updating-hoc
pnpm add react-updating-hoc
yarn add react-updating-hoc
bun add react-updating-hoc
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.1 |
| Published | 2020-02-24 |
| First published | 2017-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | alxe.master@gmail.com |
| Maintainers | alxe.master |
| Keywords | update, load, async, action, did, mount, componentDidMount, componentWillReceiveProps, component, props, change, changing |

## Links

- npm: https://www.npmjs.com/package/react-updating-hoc
- Repository: https://github.com/aliaksandr-master/react-updating-hoc
- Homepage: https://github.com/aliaksandr-master/react-updating-hoc#readme
- Issues: https://github.com/aliaksandr-master/react-updating-hoc/issues
- npm.io page: https://npm.io/package/react-updating-hoc

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.3.1 (latest) — 2020-02-24
- 2.3.0 — 2020-02-24
- 2.2.0 — 2020-01-13
- 2.1.1 — 2017-06-07
- 2.1.0 — 2017-05-31
- 2.0.0 — 2017-05-31
- 1.0.1 — 2017-02-15
- 1.0.0 — 2017-02-03

## README

[![npm](http://img.shields.io/npm/v/react-updating-hoc.svg?style=flat-square)](https://www.npmjs.com/package/react-updating-hoc)
[![npm](http://img.shields.io/npm/l/react-updating-hoc.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![Dependency Status](https://david-dm.org/aliaksandr-master/react-updating-hoc.svg?style=flat-square)](https://david-dm.org/aliaksandr-master/react-updating-hoc)
[![devDependency Status](https://david-dm.org/aliaksandr-master/react-updating-hoc/dev-status.svg?style=flat-square)](https://david-dm.org/aliaksandr-master/react-updating-hoc#info=devDependencies)

# react-updating-hoc

```shell
$ npm install react-updating-hoc recompose react lodash --save
```

## Usage 

```js
import React from 'react';
import updating, { callWhen, callWhenPropsAreUpdated, callWhenPropsAreUpdatedDeeply, callWhen } from 'react-updating-hoc';

const SomeComponent = () => (<div>Hello wordl!</div>);

export default updating(
  callWhen((props) => Boolean(props.some), (props) => {
      // do something useful
  }),
  callWhenPropsAreUpdated([ 'some', 'any' ], (props) => {
      // do something useful
  }),
  callWhenPropsAreUpdatedDeeply([ 'some', 'any' ], (props) => {
      // do something useful
  }),
  callWhenPropsAreUpdated([ 'some.nested.prop', 'any' ], (props) => { // shallow equality check with lodash get
      // do something useful
  }, true),
  callWhenPropsAreUpdatedDeeply([ 'some.nested.prop', 'any' ], (props) => { // deep equality check with lodash get
      // do something useful
  }, true)
)(SomeComponent);
```

---
_Source: https://npm.io/package/react-updating-hoc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
