Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-debounced-props

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-debounced-props

higher order component for debouncing React component updates for props

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-debounced-props

A higher order component (HOC) that allows debouncing React component updates for a specified set of props. The debounce function is specified as an argument so it may be chosen by the user. e.g. lodash.debounce can be used.

Install

npm install react-debounced-props

Example usage

Basic usage:

import { debounce } from "lodash";
import withDebouncedProps from "react-debounced-props";

const MyDebouncedComponent = withDebouncedProps(
  ["myQuicklyUpdatedProp"], func => debounce(func, 200)
)(MyComponent);

Example usage with react-apollo's graphql HOC:

import { debounce } from "lodash";
import { compose, graphql } from "react-apollo";

const MyEnhancedComp = compose(
  withDebouncedProps(["regionName"], func => debounce(func, 200)),
  graphql(REGIONS_QUERY),
)(MyComponent);

Ideas from

Keywords

FAQs

Package last updated on 26 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc