Skip to content

Commit

Permalink
Prepare for 6.0.0 release:
Browse files Browse the repository at this point in the history
- Update documentation, addressing issue #15
- Add Thomas0c to list of contributors
- Update to most recent @babel
  • Loading branch information
podefr committed Feb 5, 2020
1 parent ddcc4a6 commit d7bd27b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"presets" : ["es2015", "react", "stage-0"]
"presets" : [
"@babel/preset-react",
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
`react-debounce-render` is a Higher Order Component that wraps your react components and debounces their rendering.

This method can be used to prevent extra renders when a react component rapidly receives new props by delaying the triggering of the render until updates become less frequent. Doing so will improve the overall rendering time of the application, thus improve the user experience.
It uses [lodash debounce](https://lodash.com/docs/#debounce) under the hood.

It uses [lodash debounce](https://lodash.com/docs/#debounce) under the hood, which means that it can be configured just like lodash debounce.

### Rationale:

Expand Down Expand Up @@ -34,14 +35,30 @@ connect(state => {

See [lodash debounce](https://lodash.com/docs/#debounce) for all options. Debounce render takes its parameters similarily to lodash debounce:

To trigger the debounce on the leader edge:

```js
import debounceRender from 'react-debounce-render';

const debouncedMyReactComponent = debounceRender(MyReactComponent, 100, { leading: false });
```

Or to ensure that at least one refresh happens every second:

```js
import debounceRender from 'react-debounce-render';

const debouncedMyReactComponent = debounceRender(MyReactComponent, 100, { maxWait: 1000 });
```

# Changelog

### 6.0.0 - FEB 04 2020

* Add support for hoisting non-react statics. See [PR #16](https://github.com/podefr/react-debounce-render/pull/16) for more details. Thanks [Thomas0c](https://github.com/Thomas0c) for the contribution!
* Update e2e tests to use the most recent React version
* Drop supports for React <= 15

### 5.0.0 - OCT 04 2018

There is no breaking change in this version despite the major version change, this is only to highlight the fact that most of the internal implementation has changed since PR #12.
Expand Down
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "react-debounce-render",
"version": "5.0.0",
"version": "6.0.0",
"homepage": "https://github.com/podefr/react-debounce-render",
"description": "A React higher order component that will debounce the rendering of your React components",
"description": "A React Higher Order component that wraps your React Components and debounces their rendering. Uses lodash.debounce under the hood.",
"main": "lib/index.js",
"scripts": {
"prepublishOnly": "rm -rf lib && babel src -d lib --copy-files",
Expand All @@ -16,21 +16,26 @@
"performance"
],
"author": "Olivier Scherrer <pode.fr@gmail.com>",
"contributors": [
{
"name": "Thomas Carlson",
"url": "https://github.com/Thomas0c"
}
],
"license": "MIT",
"dependencies": {
"hoist-non-react-statics": "^3.3.2",
"lodash.debounce": "^4.0.8"
},
"peerDependencies": {
"react": ">= 15"
"react": ">= 16"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1"
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit d7bd27b

Please sign in to comment.