Fireship · @fireship
RxFire - Firebase meets RxJS
Uploaded August 24, 2018 · Length 12:23
Summary
Learn how to use RxFire to build reactive web components with Firebase and StencilJS.
- rxjs firebase
- rx fire
- reactive programming
- web components
- stenciljs
- firebase sdk
- lazy loading
- progressive web app
- google auth
- firebase authentication
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:06
one of the biggest challenges for web
- 0:08
developer is to maintain asynchronous
- 0:10
callback based code in firebase
- 0:13
everything is real-time so it only makes
- 0:15
sense that we use the best reactive
- 0:16
programming library out there which is
- 0:18
rxjs in today's video you'll learn about
- 0:21
a brand new officially supported library
- 0:23
from firebase called rx fire we'll use
- 0:26
it along with stencil Jas to compose
- 0:27
full stack reactive web components that
- 0:30
can be used in any JavaScript framework
- 0:32
or just in some plain HTML if you're new
- 0:34
here like and subscribe and grab the
- 0:36
full source code from angular
- 0:37
firebase.com let's start by talking a
- 0:40
little bit more about what rx fire is
- 0:41
and when you would want to use it the
- 0:43
first thing I'll point out is that it's
- 0:45
not a replacement for angular fire - so
- 0:47
you want to continue using angular fire
- 0:49
- in an angular project but it does
- 0:51
provide a way for other frameworks to
- 0:53
have a consistent implementation of
- 0:54
firebase with rxjs so you can get really
- 0:57
good control flow on your real time
- 0:59
streams whether you're using view react
- 1:01
stencil as we'll see later in the video
- 1:03
or just plain JavaScript I recommend
- 1:05
taking a look at the RX fire samples
- 1:07
repo so you can see it in action in a
- 1:09
variety of different settings and
- 1:11
another really cool thing about this
- 1:12
library is that it doesn't take the
- 1:14
firebase SDK as a hard dependency which
- 1:17
opens the door for lazy loading the
- 1:19
firebase SDK is pretty large so if you
- 1:21
can get it out of your critical path
- 1:22
you'll get much quicker page loads for
- 1:24
your progressive web app so what I want
- 1:27
to show you today is how we can take
- 1:28
this library and use it with a web
- 1:30
component tool like stencil j/s to build
- 1:33
a reusable to-do list that you can just
- 1:35
drop into any other app that's already
- 1:37
using firebase there's a ton of
- 1:39
potential here to build web components
- 1:41
that get reused across multiple
- 1:42
applications for example you might build
- 1:44
a chat client that is similar to
- 1:46
intercom or maybe you just want to have
- 1:48
a consistent login button that you can
- 1:50
easily share across multiple web
- 1:52
applications there's just tons of
- 1:54
potential there but it's time to get
- 1:55
moving on to the code I'm going to start
- 1:57
by initializing stencil if you're not
- 1:59
familiar with stencil don't worry it's a


