Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Throttle the number of times render() is called

License

Notifications You must be signed in to change notification settings

storybook-eol/react-throttle-render

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-throttle-render

npm version

Throttle the number of times render() is called.

Description

It may enhance the performance under the following conditions.

  • The component receives new props frequently.
  • The component has a huge or slow render().

Installation

npm i --save react-throttle-render

Usage

import throttle from 'react-throttle-render'

const ThrottledComponent = throttle(50)(VeryBigRenderComponent)

API

throttle(wait[, option]) => component => wrappedComponent

  • wait The number of milliseconds to throttle
  • option The option for lodash.throttle
  • component The source React component
  • wrappedComponent The throttled React component

License

MIT

About

Throttle the number of times render() is called

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%