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
100
Other Decks in Programming
See All in Programming
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
霧の中の代数的エフェクト
funnyycat
1
240
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.3k
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
260
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.7k
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
250
Contextとはなにか
chiroruxx
1
390
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
140
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
7
1.9k
AIエージェントで 変わるAndroid開発環境
takahirom
1
430
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.7k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
610
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
BBQ
matthewcrist
89
10k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
230
A Tale of Four Properties
chriscoyier
163
24k
Paper Plane (Part 1)
katiecoart
PRO
0
9.5k
The Cult of Friendly URLs
andyhume
79
6.9k
We Are The Robots
honzajavorek
0
270
Statistics for Hackers
jakevdp
799
230k
How to build a perfect <img>
jonoalderson
1
5.8k
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