
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
This is a simple React hooks for google cloud firestore database.
npm install firebase makefire
Setup firebase with your app configuration and then create useDocument
and useCollection
hooks with makefire
import * as firebase from 'firebase/app'
import "firebase/firestore";
import makefire from 'makefire'
const firebaseConfiguration = {
apiKey: '### FIREBASE API KEY ###',
authDomain: '### FIREBASE AUTH DOMAIN ###',
projectId: '### CLOUD FIRESTORE PROJECT ID ###'
};
firebase.initializeApp(firebaseConfiguration)
const db = firebase.firestore()
const { useDocument, useCollection } = makefire(db)
Now you can use them on your components. Insert the path for the collection or document in database as the first argument for the hooks.
function CoolComponent(props) {
// subscribing to document 'bob' in 'users' collection
const { data, loading, error } = useDocument('users/bob')
// subscribing to 'users' collection
const { data, loading, error } = useCollection('users')
// subscribing to 'users' collection with additional queries
const { data, loading, error } = useCollection('users', [['age', '>=', 21], ['location', '==', 'Jakarta']])
...
);
}
FAQs
React hooks for google cloud firestore database
We found that makefire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.