easy-peasy
easy-peasy copied to clipboard
Which syntax is preffered. To destruct values or not?
Using destruction:
const { username, posts, messages} = useStoreState((state) => state);
Or accessing a value directly
const username = useStoreState((state) => state.username);
const posts = useStoreState((state) => state.posts);
const messages = useStoreState((state) => state.messages);
I heard there is a some difference in performance, if that's true which approach is better, and how significant it actually is?