1.1.0 • Published 7 years ago
uselog-hook v1.1.0
This tiny development hook for react saves you some time when you just want to observe a single state variable or multiple state variables at the same time.

npm install --save uselog-hook
Usage
import useLog from 'uselog-hook';Assume there are three state variables.
const [apple, setApple] = useState(0);
const [orange, setOrange] = useState(0);
const [kiwi, setKiwi] = useState(0);useLog(apple);
> 0useLog([apple, orange]);
> 0
> 0useLog({apple, orange});
> {apple: 0, orange: 0}useLog({'Num of apples: ': apple});
> {'Num of apples': 0}