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.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
110
Other Decks in Programming
See All in Programming
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
5k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
500
FastAPI の並行処理モデルを完全に理解する
hoto17296
7
2.5k
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
450
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
960
30年振りにコンパイラの定数整数除算を改善した
herumi
7
3.7k
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
190
初めての模倣学習とVLA
natsutan
0
160
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
320
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
270
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
140
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
350
Technical Leadership for Architectural Decision Making
baasie
3
520
How to Talk to Developers About Accessibility
jct
2
520
Odyssey Design
rkendrick25
PRO
2
770
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Mind Mapping
helmedeiros
PRO
1
330
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
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