In this post, you will learn how to observe items from the Firebase databases in real-time using combine framework.
The database is at the heart of every application, be it Android, iOS, or the Web. When it comes to iOS databases, there are so many popular options like Coredata, SQLite, and Realm.
They all have a common disadvantage though, they are local databases and thus it’s not sufficient if we want our users to interact with each other or want to store data in the cloud.
If we want to save data in the cloud, we will need a backend, which mostly comes at a huge cost.
That’s where the Firebase database comes into the picture. I’m not going to list out all the benefits of it as it’s a well-known database in the community but you can check out official docs for more information.
Today, we will explore how we can observe items from the database in real-time using combine framework.
Initially, we will understand an example but later we will create an extension that can convert any database reference to a combine stream.
For detailed implementation, please check out canopas blog.