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
910
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
270
Design It! in a nutshell
nunulk
1
230
PHP Getting Faster
nunulk
0
230
How does learning English broaden your world?
nunulk
0
320
Testing on Laravel
nunulk
1
1.4k
Nuxt.js in TypeScript
nunulk
1
400
A startup meets Laravel + Vue.js
nunulk
1
1.9k
Unit Testing Laravel
nunulk
0
450
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
560
Other Decks in Technology
See All in Technology
フロントエンドも盛り上げたい!フロントエンドCBとAmplifyの軌跡
mkdev10
2
270
От ручной разметки к LLM: как мы создавали облако тегов в Lamoda. Анастасия Ангелова, Data Scientist, Lamoda Tech
lamodatech
0
690
Running JavaScript within Ruby
hmsk
3
300
AIで進化するソフトウェアテスト:mablの最新生成AI機能でQAを加速!
mfunaki
0
130
The Tale of Leo: Brave Lion and Curious Little Bug
canalun
1
110
Classmethod AI Talks(CATs) #21 司会進行スライド(2025.04.17) / classmethod-ai-talks-aka-cats_moderator-slides_vol21_2025-04-17
shinyaa31
0
560
AI AgentOps LT大会(2025/04/16) Algomatic伊藤発表資料
kosukeito
0
140
MCPを活用した検索システムの作り方/How to implement search systems with MCP #catalks
quiver
11
6.2k
NLP2025 参加報告会 / NLP2025
sansan_randd
4
570
Amazon CloudWatch Application Signals ではじめるバーンレートアラーム / Burn rate alarm with Amazon CloudWatch Application Signals
ymotongpoo
5
400
20250408 AI Agent workshop
sakana_ai
PRO
15
3.8k
アジャイル脅威モデリング#1(脅威モデリングナイト#8)
masakane55
3
190
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
Docker and Python
trallard
44
3.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
How to Ace a Technical Interview
jacobian
276
23k
Speed Design
sergeychernyshev
29
890
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
The Language of Interfaces
destraynor
157
24k
Gamification - CAS2011
davidbonilla
81
5.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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); }
σϞ