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
310
How to build beautiful Vuesualizations
ntepluhina
0
81
Other Decks in Programming
See All in Programming
ベクトル検索システムの気持ち
monochromegane
30
9.6k
ミリしらMCP勉強会
watany
4
680
PHPのガベージコレクションを深掘りしよう
rinchoku
0
260
AtCoder Heuristic First-step Vol.1 講義スライド(山登り法・焼きなまし法編)
takumi152
4
1k
新卒から4年間、20年もののWebサービスと 向き合って学んだソフトウェア考古学
oguri
8
7.1k
Go1.24で testing.B.Loopが爆誕
kuro_kurorrr
0
170
複数ドメインに散らばってしまった画像…! 運用中のPHPアプリに後からCDNを導入する…!
suguruooki
0
450
Kamal 2 – Get Out of the Cloud
aleksandrov
1
150
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
1
100
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
180
リアルタイムレイトレーシング + ニューラルレンダリング簡単紹介 / Real-Time Ray Tracing & Neural Rendering: A Quick Introduction (2025)
shocker_0x15
1
260
プログラミング教育のコスパの話
superkinoko
0
130
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
45
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
Fireside Chat
paigeccino
37
3.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
Become a Pro
speakerdeck
PRO
27
5.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
30
1.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.4k
Unsuck your backbone
ammeep
670
57k
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