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
96
Other Decks in Programming
See All in Programming
GitHubCopilotCLIをはじめよう.pdf
htkym
0
320
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.1k
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
970
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
460
의존성 주입과 모듈화
fornewid
0
160
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
150
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
350
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
240
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
400
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
160
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Making Projects Easy
brettharned
120
6.6k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Everyday Curiosity
cassininazir
0
200
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
Information Architects: The Missing Link in Design Systems
soysaucechin
0
910
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
GitHub's CSS Performance
jonrohan
1032
470k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Are puppies a ranking factor?
jonoalderson
1
3.4k
How STYLIGHT went responsive
nonsquared
100
6.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