react-use-curry
v1.0.1
Published
```tsx import React from 'react' import ReactDOM from 'react-dom' import { useCurry } from 'react-use-curry'
Downloads
1
Readme
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)