JSPM

rescript-throttle-react

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q51311F
  • License MIT

Throttle hooks for @rescript/react

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rescript-throttle-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    rescript-throttle-react

    version license build

    Throttle hooks for @rescript/react.

    ShakaCode

    If you are looking for help with the development and optimization of your project, ShakaCode can help you to take the reliability and performance of your app to the next level.

    If you are a developer interested in working on ReScript / TypeScript / Rust / Ruby on Rails projects, we're hiring!

    Installation

    # yarn
    yarn add rescript-throttle-react
    # or npm
    npm install --save rescript-throttle-react

    Then add it to rescript.json:

    "bs-dependencies": [
      "rescript-throttle-react"
    ]

    Usage

    // With default timeout (100ms)
    let fn = fn->ReactThrottle.useThrottled
    
    // With configured timeout
    let fn = fn->ReactThrottle.useThrottled(~wait=250)
    
    // Controlled hook
    let fn = fn->ReactThrottle.useControlled

    See rescript-throttle for more details.

    License

    MIT.