2019-04-09 17:51:35 -07:00
2019-04-09 17:37:41 -07:00
2019-04-04 14:19:09 -07:00
2019-03-11 18:07:21 -07:00
2016-03-10 11:58:09 -08:00
2019-03-22 10:48:38 -07:00
2019-04-09 17:51:35 -07:00
2019-04-08 15:35:51 -07:00

ReactFire

Hooks that make it easy to interact with Firestore, Realtime Database, Authentication, and Storage. Note, every reactfire hook throws a Promise until it has connected to Firebase. Wrap your components in React's Suspense, or, if you don't want to deal with Suspense, pass an initial value to a reactfire hook. Example.

Usage

Authentication

useUser

useUser(auth: auth.Auth, options?: ReactFireOptions): User

Example use

Firestore

useFirestoreDoc

function useFirestoreDoc(
  ref: firestore.DocumentReference,
  options?: ReactFireOptions
): firestore.DocumentSnapshot;

Example use

useFirestoreCollection

function useFirestoreCollection(
  ref: firestore.CollectionReference,
  options?: ReactFireOptions
): firestore.QuerySnapshot;

Example use

Realtime Database

useDatabaseObject

function useDatabaseObject(
  ref: database.Reference,
  options?: ReactFireOptions
): QueryChange;

Example use

useDatabaseList

function useDatabaseList(
  ref: database.Reference | database.Query,
  options?: ReactFireOptions
): QueryChange[];

Example use

Cloud Storage for Firebase

useStorageTask

function useStorageTask(
  task: storage.UploadTask,
  ref: storage.Reference,
  options?: ReactFireOptions
): storage.UploadTaskSnapshot;

Example use

useStorageDownloadURL

function useStorageDownloadURL(
  ref: storage.Reference,
  options?: ReactFireOptions
): string;

Example use

For development

  1. yarn install
  2. cd into the reactfire/reactfire directory. run yarn run watch.
  3. In a new terminal, cd into the reactfire/sample-simple directory. run yarn start.
  4. Head over to https://localhost:3000 to see the running sample

Testing

  1. cd into the reactfire/reactfire directory
  2. run yarn test
Description
No description provided
Readme MIT 3.4 MiB
Languages
TypeScript 96.2%
JavaScript 1.7%
Dockerfile 1.1%
Shell 1%