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.3k
1
Share
You Might Not Need Vuex
A few alternatives to Vuex state management in Vue application
Natalia Tepluhina
February 21, 2020
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
95
Other Decks in Programming
See All in Programming
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
220
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
350
10 Tips of AWS ~Gen AI on AWS~
licux
5
310
의존성 주입과 모듈화
fornewid
0
130
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
480
実践CRDT
tamadeveloper
0
450
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
720
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
270
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
770
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
130
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
Building the Perfect Custom Keyboard
takai
2
730
Building Adaptive Systems
keathley
44
3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The untapped power of vector embeddings
frankvandijk
2
1.7k
ラッコキーワード サービス紹介資料
rakko
1
3M
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
130
A better future with KSS
kneath
240
18k
4 Signs Your Business is Dying
shpigford
187
22k
The Limits of Empathy - UXLibs8
cassininazir
1
290
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
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