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
Vue.js + TypeScript + Firebase
Search
nunulk
January 19, 2019
Technology
0
960
Vue.js + TypeScript + Firebase
nunulk
January 19, 2019
Tweet
Share
More Decks by nunulk
See All by nunulk
Laravelでテストしやすいコードを書く5 / 5 tips of building testable modules in Laravel
nunulk
0
320
Design It! in a nutshell
nunulk
1
270
PHP Getting Faster
nunulk
0
280
How does learning English broaden your world?
nunulk
0
370
Testing on Laravel
nunulk
1
1.5k
Nuxt.js in TypeScript
nunulk
1
440
A startup meets Laravel + Vue.js
nunulk
1
2k
Unit Testing Laravel
nunulk
0
490
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
590
Other Decks in Technology
See All in Technology
Vitest Highlights in Angular
rainerhahnekamp
0
120
メルカリのAI活用を支えるAIセキュリティ
s3h
8
5.8k
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
660
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
0
210
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
4
630
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
180
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
1
330
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.3k
AIとともに歩む情報セキュリティ / Information Security with AI
kanny
4
2.9k
Amazon Bedrock AgentCore EvaluationsでAIエージェントを評価してみよう!
yuu551
0
200
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
600
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
130
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
YesSQL, Process and Tooling at Scale
rocio
174
15k
GraphQLとの向き合い方2022年版
quramy
50
14k
Context Engineering - Making Every Token Count
addyosmani
9
640
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Building an army of robots
kneath
306
46k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
810
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); }
σϞ