2019-04-18 11:29:53 -07:00
2019-04-15 12:27:07 -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-15 12:27:07 -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.

Interfaces

ReactFireOptions

Property Type
startWithValue any

Hooks

useDatabaseList

Subscribe to a Realtime Database list

Parameters

Parameter Type
ref Reference or Query
options ? ReactFireOptions

Returns

QueryChange[]

useDatabaseObject

Subscribe to a Realtime Database object

Parameters

Parameter Type
ref Reference
options ? ReactFireOptions

Returns

QueryChange

useFirestoreCollection

Subscribe to a Firestore collection

Parameters

Parameter Type
ref CollectionReference
options ? ReactFireOptions

Returns

QuerySnapshot

useFirestoreDoc

Suscribe to Firestore Document changes

Parameters

Parameter Type
ref DocumentReference
options ? ReactFireOptions

Returns

DocumentSnapshot

useStorageDownloadURL

Subscribe to a storage ref's download URL

Parameters

Parameter Type
ref Reference
options ? ReactFireOptions

Returns

string

useStorageTask

Subscribe to the progress of a storage task

Parameters

Parameter Type
task UploadTask
ref Reference
options ? ReactFireOptions

Returns

UploadTaskSnapshot

useUser

Subscribe to Firebase auth state changes, including token refresh

Parameters

Parameter Type
auth Auth
options ? ReactFireOptions

Returns

User

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%