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
800
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ngxs
ngxs - state management made simple
Jecelyn Yeen
January 10, 2019
More Decks by Jecelyn Yeen
See All by Jecelyn Yeen
WorkerConf 2021 - Browser automation with Puppeteer
jecfish
0
1.9k
My Journey as Technical Presenter
jecfish
0
1k
Becoming a GDE
jecfish
0
3.9k
How to get started in IT Freelancing
jecfish
1
300
New Web API & Stylings
jecfish
3
750
如何打造高性能且SEO友好的单页应用(SPA)
jecfish
2
910
JS SEO
jecfish
4
1.6k
Web Performance Optimization
jecfish
5
1.8k
Have Fun with Angular
jecfish
0
130
Other Decks in Programming
See All in Programming
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
510
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
CSC307 Lecture 17
javiergs
PRO
0
320
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.2k
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
370
JavaDoc 再入門
nagise
0
300
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3.2k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
160
Swiftのレキシカルスコープ管理
kntkymt
0
220
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
470
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
The Cost Of JavaScript in 2023
addyosmani
55
10k
Google's AI Overviews - The New Search
badams
0
1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Un-Boring Meetings
codingconduct
0
310
Navigating Team Friction
lara
192
16k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
320
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
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