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
330
How to build beautiful Vuesualizations
ntepluhina
0
94
Other Decks in Programming
See All in Programming
Unity6.3 AudioUpdate
cova8bitdots
0
110
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.6k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
400
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
680
浮動小数の比較について
kishikawakatsumi
0
370
Codex の「自走力」を高める
yorifuji
0
190
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
160
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
170
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
310
Featured
See All Featured
Designing for Performance
lara
611
70k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
270
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Google's AI Overviews - The New Search
badams
0
930
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
950
Context Engineering - Making Every Token Count
addyosmani
9
730
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
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