$30 off During Our Annual Pro Sale. View Details »
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
950
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
270
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
580
Other Decks in Technology
See All in Technology
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
220
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
4
1.1k
AWS運用を効率化する!AWS Organizationsを軸にした一元管理の実践/nikkei-tech-talk-202512
nikkei_engineer_recruiting
0
170
「もしもデータ基盤開発で『強くてニューゲーム』ができたなら今の僕はどんなデータ基盤を作っただろう」
aeonpeople
0
250
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
150
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
230
2025-12-18_AI駆動開発推進プロジェクト運営について / AIDD-Promotion project management
yayoi_dd
0
160
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.3k
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
770
普段使ってるClaude Skillsの紹介(by Notebooklm)
zerebom
8
2.2k
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
140
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Paper Plane (Part 1)
katiecoart
PRO
0
2.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Code Review Best Practice
trishagee
74
19k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.8k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.9k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
YesSQL, Process and Tooling at Scale
rocio
174
15k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
The SEO Collaboration Effect
kristinabergwall1
0
310
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); }
σϞ