oo-firebase
v6.4.8
Published
A object-oriented class providing methods to encapsulate Firebase/Firestore functionality
Downloads
22
Readme
oo-firebase
A model is defined as a "materialized" collection schema.
A model is "materialized" in the sense that it "materializes" the collection within the schema.
A collection is "materialized" in the sense that it "materializes" the documents within the collection.
A document is "materialized" in the sense it "materializes" the document data and calculated values within the document.
DatabaseDocument data and calculated values are "materialized" in the sense that they are provided to the client without the need for additional requests to the database or server.
For example, with an "unmaterialized" document, you would need to do the following to asynchronously fetch a username in the frontend:
const username = await user.username();
Whereas a username on a "materialized" document can be synchronously called with a getter:
const username = user.username;
Next.js users will need to add 'oo-firebase' to the transpilePackages array in their project's nextConfig, as follows:
const nextConfig = { ... transpilePackages: ['oo-firebase'], }; module.exports = nextConfig;
Firebase users will also need to enable each provider in their Authentication settings.