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
90
Other Decks in Programming
See All in Programming
私の後悔をAWS DMSで解決した話
hiramax
4
140
ゲームの物理
fadis
5
1.5k
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.6k
Laravel Boost 超入門
fire_arlo
1
130
TanStack DB ~状態管理の新しい考え方~
bmthd
2
340
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
230
自作OSでDOOMを動かしてみた
zakki0925224
1
1.4k
RDoc meets YARD
okuramasafumi
2
130
AWS Serverless Application Model入門_20250708
smatsuzaki
0
130
A Gopher's Guide to Vibe Coding
danicat
0
170
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
840
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
980
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
RailsConf 2023
tenderlove
30
1.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Faster Mobile Websites
deanohume
309
31k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Speed Design
sergeychernyshev
32
1.1k
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