Socket
Socket
Sign inDemoInstall

@18f/redux-textarea-debounce

Package Overview
Dependencies
21
Maintainers
13
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @18f/redux-textarea-debounce

textarea component whose onchange is debounced, perfect for use in redux apps


Version published
Maintainers
13
Install size
159 kB
Created

Readme

Source

redux-textarea-debounce

A React component that emulates a <textarea> but debounces the onChange event, which is especially useful for redux apps. If you try to handle every onChange by routing it through the dispatcher and all that fun stuff, your app may begin to lag. This app helps with that!

Installation

npm i @18f/redux-textarea-debounce

Usage

Whatever function you provide as the onChange prop is debounced so it only runs at most once every 200ms. As long as the user keeps typing, it won't run at all - unless they slow down long enough.

It's as much like a regular textarea as possible:

import TextArea from '@18f/redux-textarea-debounce';

function handler(e) {
  // You get the full SyntheticEvent object, but
  // not on every change - at most once every 200ms
  console.log(e.target.value);
}

render() {
  return (
    <TextArea value="initial value" onChange={handler} />
  );
}
PropTypeDescription
valuestringThe initial text value of the text area.
namestringA name for the component, passed down to the underlying <textarea> - this will show up on the event as event.target.name.
onChangefunctionThe event handler for change events, called at most once ever 200ms. Receives one argument, a React SyntheticEvent from the underlying real <textarea> component.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Keywords

FAQs

Last updated on 03 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc