paint-brush
RTK for the useReducer Hook: A Guideby@anatolii
557 reads
557 reads

RTK for the useReducer Hook: A Guide

by Anatolii Kabanov4mNovember 23rd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Hook is a way to keep and manage data in the store for the particular component and its children. Hook will return the State and functions to change the state. Hook then will have a standard switch-case implementation; I wrapped it with `produce` function from the Immer lib. It’s to avoid mistakes while coping in full state. But yeah, in the very original reducer where the object of the state is without multiple nested objects, I will only use the spread operator.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - RTK for the useReducer Hook: A Guide
Anatolii Kabanov HackerNoon profile picture
Anatolii Kabanov

Anatolii Kabanov

@anatolii

Developing and enjoying life. Life is one, implement yours. All the best in your endeavors.

About @anatolii
LEARN MORE ABOUT @ANATOLII'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Anatolii Kabanov HackerNoon profile picture
Anatolii Kabanov@anatolii
Developing and enjoying life. Life is one, implement yours. All the best in your endeavors.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite