Redux Toolkit · Hook
useAppSelector
A Redux selector is a function that reads the needed value from store state. Reusable selectors keep lookup logic in slice files and can accept extra arguments such as an item ID.
Last updated
Syntax
const selectPostById = (state: RootState, postId: string) => state.posts.find(post => post.id === postId)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
useAppSelectorRootStatecreateSlicecreateSelectorselectAllPostsselectPostById