New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-debouncing

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-debouncing

$ npm install react-debouncing

1.0.3
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Installation

$ npm install react-debouncing

Or :

$ yarn add react-debouncing

Example

import React, { Component } from 'react';
import debounce from 'react-debouncing';

class Debounce extends Component {
  state = {
    count: 0,
  };

  increment = debounce(() => {
    this.setState({
      count: this.state.count + 1,
    });
  }, 500);

  decrement = debounce(() => {
    this.setState({
      count: this.state.count - 1,
    });
  }, 500);

  render() {
    return (
      <div>
        <div>{this.state.count}</div>
        <button onClick={this.increment}> + </button>
        <button onClick={this.decrement}> - </button>
      </div>
    );
  }
}

Keywords

debounce

FAQs

Package last updated on 14 Dec 2019

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