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
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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Vue.js + TypeScript + Firebase
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
430
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
520
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
610
Other Decks in Technology
See All in Technology
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
190
DevelopersIO 2026 Tokyo 現時点の衛星通信サービスの現状を整理してみる
maroon1st
0
180
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
340
「Learning Outcome」を書きたくない私が、Learning Outcomeと折り合いをつけるまで
mhlyc
0
120
CloudWatch Logsのコスト最適化:どこまでAIに任せてどこから人間が承認すべきか
yama3133
0
160
VLA-JEPA: Enhancing Vision-Language-Action Models with Latent World Models
takmin
0
120
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
350
ポケモン対戦を自動で記録して振り返ろう
fufufukakaka
0
280
macOS Golden Gate 時代のMac管理
tategami
0
130
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
330
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
150
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.3k
Featured
See All Featured
Docker and Python
trallard
47
4.2k
A Soul's Torment
seathinner
8
3.8k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
My Coaching Mixtape
mlcsv
0
360
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Everyday Curiosity
cassininazir
0
360
Testing 201, or: Great Expectations
jmmastey
46
8.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
640
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); }
σϞ