react-use-curry
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-use-curry

How to use it

import React from 'react'
import ReactDOM from 'react-dom'
import { useCurry } from 'react-use-curry'

import useWaterCoolingStore from '...'
import './styles.css'

function Rothobot(props) {
  const waterCoolingStore = useWaterCoolingStore()

  const handleRap = useCurry(
    (name: string, vacuumCleaner: string) => {
      waterCoolingStore.drive(name, vacuumCleaner)
    },
    [waterCoolingStore]
  )

  return (
    <div className="App">
      {props.peopleFromRothobot.map((rothobotCitizen) => (
        <button
          key={rothobotCitizen.id}
          // onClick={handleRap(rothobotCitizen.name, rothobotCitizen.dog)}
          onClick={handleRap(rothobotCitizen.name)(rothobotCitizen.dog)}
        >
          click
        </button>
      ))}
    </div>
  )
}

const rootElement = document.getElementById('root')
ReactDOM.render(<Rothobot />, rootElement)

Dependents (0)

Package Sidebar

Install

npm i react-use-curry

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

4.9 kB

Total Files

7

Last publish

Collaborators

  • lorof