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
You Might Not Need Vuex
Search
Natalia Tepluhina
February 21, 2020
Programming
1
1.3k
You Might Not Need Vuex
A few alternatives to Vuex state management in Vue application
Natalia Tepluhina
February 21, 2020
Tweet
Share
More Decks by Natalia Tepluhina
See All by Natalia Tepluhina
All you need is Apollo Client
ntepluhina
0
320
How to build beautiful Vuesualizations
ntepluhina
0
93
Other Decks in Programming
See All in Programming
rack-attack gemによるリクエスト制限の失敗と学び
pndcat
0
240
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
850
Implementation Patterns
denyspoltorak
0
240
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
910
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
100
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
330
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
150
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
570
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
340
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
140
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
290
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Automating Front-end Workflow
addyosmani
1371
200k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
110
How to Ace a Technical Interview
jacobian
281
24k
Are puppies a ranking factor?
jonoalderson
1
2.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
41
Paper Plane (Part 1)
katiecoart
PRO
0
3.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
New Earth Scene 8
popppiees
1
1.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
130
Transcript
YOU MIGHT NOT NEED VUEX
YOU MIGHT NOT NEED VUE
Core Team Member My name is Natalia Tepluhina Google Developer
Expert Senior Frontend Engineer @N_Tepluhina
Do I need a shared state?
“ “Flux libraries are like glasses: you'll know when you
need them” Dan Abramov
Independent components Different routes Deep nesting
Provide/inject approach
Provide Inject
Reactive object
Don’t change data where it’s injected!
Composition API to the rescue
posva/pinia Automatically typed, modular and lightweight store for Vue using
the Composition api with DevTools support Eduardo San Martin Morote
Creating a store
Using a store in components
DEMO
Let’s get some GraphQL hype!
vue-apollo Integrates Apollo in your Vue components with declarative queries.
Compatible with Vue 2.0+ and 3.0+. Guillaume Chau
Dispatch an action Trigger API call Success? Commit ‘success’ mutation
State changed Commit ‘error’ mutation Yes No
None
Query Success/error State changed
Ok but what about local state?
Local state* = Apollo Cache *everything is Apollo Cache
‘Normal’ query…
..vs local query
Setting initial state
Changing data
Read the cache Update data Write back to the cache
DEMO
Thanks! You can find demo repository at bit.ly/no-vuex