You will walk away from this workshop being able to do all of these things by yourself.
- 01. Build reactive applications in Angular with NgRx
NgRx enables you to build applications that react to new state that is pushed into the Store. Combined with the power of RxJS our applications can efficiently provide a rich user experience.
- 02. Demystify NgRx - you already know NgRx!
Angular components have inputs and output, handle state transitions, and perform side effects. Using this same mental model we can start to understand NgRx.
- 03. Event storming and good action hygiene
Event storming enables you to start designing the actions as a result of events in your application before writing a single line of code. Combined with good action hygiene and you'll be building performant, and easy to debug, Angular applications with NgRx.
- 04. Handle state transitions
You'll learn how to define reducers to immutably producing new state. You'll also learn that reducers are pure functions, so we'll never perform any side effect in our reducers.
- 05. Compose selectors
Defining and composing selectors enables you to efficiently query for data in the Store.
- 06. Perform Side Effects
The Effects library from NgRx enables you to perform a side effect as a result of a dispatched action. You'll be using effects to load data from services into the Store.
- 07. Finally master higher-order mapping operating in RxJS
Choosing the correct operator in RxJs is hard. Combine that with writing effects that can contain race conditions, and it's even harder to get this right. We'll break down the 4 common higher-order mapping operators and give you a clear path for choosing the correct one in each situation.
- 08. Manage collections of data in the Store
Collections of entities is a common pattern, and NgRx provides a set of basic state operations and selectors to manage collections in the Store.
- 09. Harness the power of meta-reducers
Meta-reducers are not widely understood and often rarely used. You'll be able to leverage meta-reducers to intercept actions and change the control flow of the Store.
Pricing
Transparent and simple pricing to skill up your team.
Day One
- Reactive Programming in Angular
- Demystifying NgRx
- You already know NgRx!
- NgRx mental model: state flows down, changes flow up
- Single responsibility principle
- Indirection between consumers of state, how state changes, and side effects
- Select and dispatch are special version of
@Input()
and@Output()
- Delegate responsibilities to individual modules of code
- NgRx Actions
- A unified interface to describe events
- Just data, no functionality
- Has a
type
property at a minimum - Good action hygiene
- Event storming
- Reducers
- Reducers produce new state
- Reducers receive the last state and next action
- Reducers listen for specific actions
- Reducers are pure function that perform immutable operations
- Setting up the Store
- Selectors
- Selectors allow us to query for data
- Selectors are recomputed when their inputs change
- Leverage memoization for performance
- Selectors are fully composable
- Effects
- Effects are processes that run in the background
- Effects connect your app to the outside world
- We often use effects to talk to services.
- Effects utilize an RxJS actions stream.
Day Two
- Advanced Effects
- Choosing the correct RxJS operator to use with effects
- Using
mergeMap()
to subscribe immediately with no race condition - Using
concatMap()
to subscribe after the last Observable completes - Using
exhaustMap()
to discard until the last Observable completes - Using
switchMap()
to cancel the last Observable if it has not yet completed
- Effects Examples
- Using effects with intervals
- Using effects with WebSocket connections
- Using effects with Angular's
HttpClient
service - Using effects to show failure state
- Using effects to display modals
- Entities
- Working with collections should be fast
- Collections of entities is very common
- Entity library provides a common set of basic state operations
- Entity library provides a common set of basic state derivations
- Meta-reducers
- Meta-reducers intercept actions before they are reduced
- Meta-reducers intercept state before it is emitted
- Using meta-reducers to change control flow of the Store
Prereqs
Attendees should be familiar with the following technologies:
- TypeScript
- Angular
- Basics of RxJS
Can't find the topic you are looking for? Contact Us to learn about our custom training solutions.