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
730
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.8k
My Journey as Technical Presenter
jecfish
0
930
Becoming a GDE
jecfish
0
3.8k
How to get started in IT Freelancing
jecfish
1
270
New Web API & Stylings
jecfish
3
690
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
840
JS SEO
jecfish
4
1.5k
Web Performance Optimization
jecfish
5
1.7k
Have Fun with Angular
jecfish
0
95
Other Decks in Programming
See All in Programming
ご注文の差分はこちらですか? 〜 AWS CDK のいろいろな差分検出と安全なデプロイ
konokenj
4
730
AI Ramen Fight
yusukebe
0
120
Jakarta EE Meets AI
ivargrimstad
0
540
Advanced Micro Frontends: Multi Version/ Framework Scenarios
manfredsteyer
PRO
0
130
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
110
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
900
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
15
9.1k
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
310
No Install CMS戦略 〜 5年先を見据えたフロントエンド開発を考える / no_install_cms
rdlabo
0
410
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
4
2.3k
NEWT Backend Evolution
xpromx
1
170
Dart 参戦!!静的型付き言語界の隠れた実力者
kno3a87
0
150
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
GitHub's CSS Performance
jonrohan
1031
460k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Site-Speed That Sticks
csswizardry
10
730
Designing Experiences People Love
moore
142
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Practical Orchestrator
shlominoach
190
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
RailsConf 2023
tenderlove
30
1.2k
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