react-hookie
v1.0.8
Published
#### Cleaning up react hooks
Downloads
12
Readme
Want a hookie? 🍪
Cleaning up react hooks
From:
const [firstname, setFirstname] = useState('Elon');
const [lastname, setLastname] = useState('Musk');
const [age, setAge] = useState(47);
To:
const initial_state = {
firstname: 'Elon',
lastname: 'Musk',
age: 47
}
const { firstname, lastname, age } = useHookie(initial_state, useState)