Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The New NGRX Signal Store for Angular: 3+n Flav...
Search
Manfred Steyer
PRO
April 23, 2024
Programming
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The New NGRX Signal Store for Angular: 3+n Flavors of the Signal Store
Manfred Steyer
PRO
April 23, 2024
More Decks by Manfred Steyer
See All by Manfred Steyer
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
180
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
110
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
180
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
230
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
160
Agentic UI
manfredsteyer
PRO
0
230
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
290
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
240
Agentic AI in the Frontend: Architectures with Open Standards @iJS London 2026
manfredsteyer
PRO
0
170
Other Decks in Programming
See All in Programming
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
220
どこまでゆるくて許されるのか
tk3fftk
0
490
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
320
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
200
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
150
act2-costs.pdf
sumedhbala
0
110
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
120
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
450
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
230
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
The browser strikes back
jonoalderson
0
1.4k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How to Ace a Technical Interview
jacobian
281
24k
A Soul's Torment
seathinner
6
3.1k
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
The SEO Collaboration Effect
kristinabergwall1
1
500
Designing for humans not robots
tammielis
254
26k
Music & Morning Musume
bryan
47
7.3k
Transcript
@ManfredSteyer ManfredSteyer The New NGRX Signal Store for Angular 3+n
Flavors of the Signal Store
@ManfredSteyer Signal as Producer 4711 Consumer read set notify 4712
@ManfredSteyer Signal Eventually Zone-less!
@ManfredSteyer flights = signal<Flight[]>([]); const flights = await this.flightService.findAsPromise(from, to);
this.flights.set(flights); <div *ngFor="let f of flights()"> <flight-card [item]="f" /> </div>
@ManfredSteyer from = signal('Paris'); to = signal('London'); flightRoute = computed(()
=> this.from() + ' to ' + this.to()); constructor() { effect(() => { console.log('from', this.from()); console.log('to', this.to()); }); }
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Component Store "Intention" Signals sync/ async computed(…) computed(…)
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Manfred Steyer
@ManfredSteyer
@ManfredSteyer @Injectable({ providedIn: 'root' }) export class FlightBookingFacade { private
state = signalState({ from: 'Paris', to: 'London', flights: [] as Flight[], basket: {} as Record<number, boolean>, }); readonly flights = this.state.flights; readonly from = this.state.from; […] }
@ManfredSteyer @Injectable({ providedIn: 'root' }) export class FlightBookingFacade { […]
readonly selected = computed( () => this.flights().filter((f) => this.basket()[f.id]) ); […] }
@ManfredSteyer @Injectable({ providedIn: 'root' }) export class FlightBookingFacade { […]
updateCriteria(from: string, to: string): void { patchState(this.state, { from, to }) } […] }
@ManfredSteyer @Injectable({ providedIn: 'root' }) export class FlightBookingFacade { […]
updateCriteria(from: string, to: string): void { patchState(this.state, (state) => ({ from: state.to, to: state.from })); } […] }
@ManfredSteyer
@ManfredSteyer export const FlightBookingStore = signalStore( { providedIn: 'root' },
[…] );
@ManfredSteyer export const FlightBookingStore = signalStore( { providedIn: 'root' },
withState({ from: 'Paris', to: 'London', […] }), […] );
@ManfredSteyer export const FlightBookingStore = signalStore( { providedIn: 'root' },
withState({ from: 'Paris', to: 'London', […] }), withComputed(([…]) => ({ […] })), withMethods(([…]) => ({ })), withHooks({ […] }) );
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer export const FlightBookingStore = signalStore( […] withMethods((state) => {
[…] return { loadByCriteria: rxMethod<Criteria>((c$) => c$.pipe([…])) }; }), […] );
@ManfredSteyer export const FlightBookingStore = signalStore( […] withMethods((state) => {
[…] return { loadByCriteria: rxMethod<Criteria>((c$) => c$.pipe([…])) }; }), […] );
@ManfredSteyer export const FlightBookingStore = signalStore( […] withMethods((state) => {
[…] return { loadByCriteria: rxMethod<Criteria>((c$) => c$.pipe( filter(c => c.from.length >= 3 && c.to.length >= 3), debounceTime(300), switchMap((c) => flightService.find(c.from, c.to)), tap(flights => patchState(state, { flights })) )) }; }), […] );
@ManfredSteyer export const FlightBookingStore = signalStore( […] withMethods((state) => {
[…] return { loadByCriteria: rxMethod<Criteria>((c$) => c$.pipe( filter(c => c.from.length >= 3 && c.to.length >= 3), debounceTime(300), switchMap((c) => flightService.find(c.from, c.to)), tap(flights => patchState(state, { flights })) )) }; }), […] );
@ManfredSteyer export const FlightBookingStore = signalStore( […] withHooks({ onInit({ loadByCriteria,
criteria }) { loadByCriteria(criteria); }, }), ); takes: Signal<T>, Observable<T>, T
@ManfredSteyer
@ManfredSteyer const BookingStore = signalStore( withEntities<FlightState>() );
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Free eBook (6th Edition) ANGULARarchitects.io/book 20 Chapters 4 new
Signal Store Chapters
@ManfredSteyer Signals: Future of CD Take Care of Data Flow
Stores are the Missing Link Signal Store Lightweight Highly Extensible
@ManfredSteyer
@ManfredSteyer d Slides & Examples Remote Company Workshops and Consulting
http://angulararchitects.io