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
ngxs
Search
Jecelyn Yeen
January 10, 2019
Programming
0
670
ngxs
ngxs - state management made simple
Jecelyn Yeen
January 10, 2019
Tweet
Share
More Decks by Jecelyn Yeen
See All by Jecelyn Yeen
WorkerConf 2021 - Browser automation with Puppeteer
jecfish
0
1.6k
My Journey as Technical Presenter
jecfish
0
860
Becoming a GDE
jecfish
0
3.6k
How to get started in IT Freelancing
jecfish
1
260
New Web API & Stylings
jecfish
3
640
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
750
JS SEO
jecfish
4
1.4k
Web Performance Optimization
jecfish
5
1.7k
Have Fun with Angular
jecfish
0
89
Other Decks in Programming
See All in Programming
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Fireside Chat
paigeccino
34
3.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Unsuck your backbone
ammeep
669
57k
Transcript
State Management Made Simple
@JecelynYeen - Google Developer Expert (GDE) - Blogger - Software
Architect - Women Who Code KL Director - ng-MY Conference Organizer
state management pattern + library for Angular
predictable state mutations
None
Why Yet Another State Management Solution?
Pick your flavor!
Reimagine State Management for Angular
Reduce Boilerplate
Rethink Developer Ergonomic & User API
Getting Started ng add @ngxs/schematics https://github.com/ngxs/schematics
Generate 2 files: .actions.ts, .state.ts ng generate @ngxs/schematics:store --name app
https://github.com/ngxs/schematics
Demo: Coffee https://ngxs-coffee.firebaseapp.com
Overview (State)
Overview (Actions) • [Coffee API] Get Coffee List • [List
Page] Add ToCart (coffeeName) • [Cart Page] Add One Cart Item (coffeeName) • [Cart Page] Remove One Cart Item (coffeeName) • [Cart Page] Remove Cart Item (coffeeName) • [Pay Component] Empty Cart
Overview (Actions) GetCoffeeList AddToCart AddOne RemoveOne Remove EmptyCart
Overview (Selectors) Coffee List Cart List Total Amount Total Quantity
Overview (Selectors) • [List Page] Coffee List • [Cart Page]
Cart List • [Pay Component] Total Cart Amount • [Header Component] Total Cart Quantity
Major NGXS Concepts Component Actions Store Plugins Backend dispatch m
utate select
Rxjs is awesome, but is it a must?
Effects can be painful
Make use of Dependency Injection (DI)
Making Actions Asynchronous
Plugins https://ngxs.gitbook.io/ngxs/plugins/intro
NGXS is extendable
CLI Router Storage Form Logger Websocket
Labs https://ngxs.gitbook.io/ngxs/ngxs-labs/intro
Innovation without Compromising Stability
Emitter - Get rid of Actions (until you really need
them)
Dispatch Decorator Immer Adapter
Extensive Documentation https://ngxs.gitbook.io/ngxs/
Do you know why it’s called NGXS? https://youtu.be/rkn73khwfWU?t=1582
Thanks for all contributors https://github.com/ngxs/store/graphs/contributors Austin Daniel | Mark Whitfeld
| Danny Blue | Leon Radley | Max Ivanov
Try me! > Twitter: @JecelynYeen Slides: https://speakerdeck.com/chybie/ngxs Demo: https://github.com/chybie/ngxs-coffee Demo
(Emitter): https://github.com/chybie/ngxs-coffee/tree/emitter-demo
Resources - Why another state management framework for Angular? -
NGXS official site - ngAir Live Video Podcast about NGXS - Announcing NGXS 3.1 - Announcing NGXS 3.3