Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Vue.js + TypeScript + Firebase
Search
nunulk
January 19, 2019
Technology
970
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vue.js + TypeScript + Firebase
nunulk
January 19, 2019
More Decks by nunulk
See All by nunulk
Laravelでテストしやすいコードを書く5 / 5 tips of building testable modules in Laravel
nunulk
0
350
Design It! in a nutshell
nunulk
1
310
PHP Getting Faster
nunulk
0
290
How does learning English broaden your world?
nunulk
0
420
Testing on Laravel
nunulk
1
1.6k
Nuxt.js in TypeScript
nunulk
1
460
A startup meets Laravel + Vue.js
nunulk
1
2.1k
Unit Testing Laravel
nunulk
0
510
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
610
Other Decks in Technology
See All in Technology
スクラムで身についていた動き方を、XPで捉え直してみた
codmoninc
PRO
1
320
omasushiというライブラリを作った
polidog
PRO
0
160
AIで仕事のやり方を変える
matsu7874
3
1k
AI時代におけるプロダクト横断勉強会の設計
zozotech
PRO
0
170
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
7
7.5k
#jawssonic2026 あの時代が悪かった ~動かなかったSageMakerと共に迎えたイベント当日~
ktkn1129
0
140
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.7k
20260912_スクフェス三河
kgnkhkr
0
100
Bet AI Day 2026丨AIによって本質に戻るシステムリスク管理
layerx
PRO
0
1.3k
When Does a Local Qwen Start to Break
morshoto
0
190
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
150
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
650
Featured
See All Featured
Amusing Abliteration
ianozsvald
1
290
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
340
The Cult of Friendly URLs
andyhume
79
7k
Claude Code のすすめ
schroneko
67
230k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
How to Ace a Technical Interview
jacobian
281
24k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
RailsConf 2023
tenderlove
30
1.5k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Transcript
Vue.js + Firebase + TypeScript Ͱ ϦΞϧλΠϜνϟοτ nunulk #ReBuildCamp
Firebase • Google ͕ఏڙ͢Δ mBaaS • Cloud Firestore (Beta), Cloud
Storage, Cloud Functions, A/B Testing, Cloud Messaging
ٕͬͨज़ • Vue.js: 2.5.22 • TypeScript: 3.2.4 • Firebase: 0.3.7
• Element: 2.4.11
ೝূ͕ඞཁͳύεͷࢦఆ routes: [ { path: '/', name: 'home', component: Home,
meta: { requiresAuth: true } },
ϛυϧΣΞ router.beforeEach((to, from, next) => { const requiresAuth = to.matched.some(record
=> record.meta.requiresAuth) if (!requiresAuth) { next() } else { firebase.auth().onAuthStateChanged(function (user) { if (user) { next() } else { next({ path: '/signin', query: { redirect: to.fullPath } })
Component export default class ChatBoard extends Vue { user: User
= { id: null, email: '', avatar_image_url: '' } participants: User[] = [] messages: Message[] = [] message: Message = { room_id, sender_id: null, content: ‘', created_at: null, }
Component created(): void { const fireUser = firebase.auth().currentUser; if (!fireUser)
{ return; } this.user.id = fireUser.uid; this.user.email = fireUser.email; db.collection('users').doc(this.user.id).get() .then((doc) => {})
Component db.collection('messages') .onSnapshot((snapshot) => { const changes = snapshot.docChanges() if
(!changes) { return } changes.forEach((change) => { if (change.type === 'added') { const message = { room_id: change.doc.data().room_id, sender_id: change.doc.data().sender_id, content: change.doc.data().content, created_at: this.timestamp2String(change.doc.data().created_at) }; this.addMessageData(message); }
σϞ