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
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
340
Design It! in a nutshell
nunulk
1
290
PHP Getting Faster
nunulk
0
290
How does learning English broaden your world?
nunulk
0
410
Testing on Laravel
nunulk
1
1.6k
Nuxt.js in TypeScript
nunulk
1
450
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
600
Other Decks in Technology
See All in Technology
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
140
RSA暗号を手計算したくなること、ありますよね?? (20260615_orestudy6_rsa)
thousanda
0
340
2026TECHFRESH畢業分享會 - AI 時代的人生存檔點
line_developers_tw
PRO
0
940
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
110
「エンジニア進化論」2028年の開発完全自動化、エンジニアはどう進化するか
cyberagentdevelopers
PRO
6
5k
"何を作るか"を任される エンジニアは、どう育つのか
yutaokafuji
1
660
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
930
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
140
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
360
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
640
社内 AI エージェント Synapse と セマンティックレイヤーの育て方
hiroakis
3
1.8k
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
140
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Visualization
eitanlees
152
17k
Speed Design
sergeychernyshev
33
1.8k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
It's Worth the Effort
3n
188
29k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Statistics for Hackers
jakevdp
799
230k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
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); }
σϞ