Skip to main content

@reduxjs/toolkit ↔ Official Opinionated redux Toolset Lib with simplified improved syntax

aka RTK, Redux-ToolKit, Redux, RTK-API, RTK-API-fn, RTK-API-Hook

Thoughts on RTK Migration

@reduxjs/toolkit/query

RTK query API to Data Fetch/Cache & replace Thunk

Source: redux

createAsyncThunk()

RTK API fn to Data Fetch from remote endpoint

Source: redux

createSlice()

RTK API fn to setup slice state with input { initialState, reducers object, name}

Source: redux

useDispatch()

RTK API Hook to dispatch an action

configureStore()

RTK API fn to replace createStore

Source: redux

useAppDispatch()

TS typed version of useDispatch() || recommended but pointless

useAppSelector()

TS Typed version for useSelector() || recommended but pointless - just export useSelector as typed version

References

  1. createSlice()RTK API fn to setup slice state with input { initialState, reducers object, name}

  2. useDispatch()RTK API Hook to dispatch an action

  3. configureStore()RTK API fn to replace createStore

  4. createAsyncThunk()RTK API fn to Data Fetch from remote endpoint

  5. @reduxjs/toolkit/queryRTK query API to Data Fetch/Cache & replace Thunk