Selectors and Effects
Handle state efficiently with selectors and effects.
Selectors and Effects is a free Angular Academy lesson on CoddyKit — lesson 3 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Angular Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Selectors and Effects in NgRx
This lesson covers selectors and effects, crucial parts of NgRx for efficient state management in Angular.

2
What are Selectors?
Selectors allow you to efficiently retrieve specific pieces of state from the store, optimizing data access.
3
Creating Selectors
Create selectors using createSelector() function to select data from state efficiently:
export const selectUser = createSelector(
(state: AppState) => state.user,
(user) => user.details
);4
Using Selectors in Components
Selectors help you access store data easily within components:
this.store.select(selectUser).subscribe(user => console.log(user));5
What are Effects?
Effects handle side effects in NgRx, such as HTTP requests, by listening for actions and performing asynchronous operations.
6
Installing Effects
Install NgRx Effects using:
npm install @ngrx/effects --save7
Creating Effects
Effects handle side effects like HTTP requests triggered by actions:
loadUser$ = createEffect(() =>
this.actions$.pipe(
ofType(loadUser),
mergeMap(() => this.userService.getUser().pipe(
map(user => loadUserSuccess({ user }))
))
)
);8
9
Registering Effects
Register effects in your module to enable them in your application:
EffectsModule.forRoot([UserEffects])10
Summary
You now understand selectors and effects in NgRx, empowering you to handle state and side-effects efficiently. Excellent job!

Frequently asked questions
Is the “Selectors and Effects” lesson free?
Yes — the full text of “Selectors and Effects” is free to read here on the web, and the Angular Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Angular Academy course, upgrade to CoddyKit PRO.
What will I learn in “Selectors and Effects”?
Handle state efficiently with selectors and effects. You practise Angular Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Angular Academy?
No prior experience is required. Angular Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Selectors and Effects” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Angular Academy lesson?
Yes. Every Angular Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- NgRx Store Essentials
- Actions and Reducers
- Selectors and Effects