Nostalgic Primordial Monster
Join us to discuss the challenges, solutions and best practices for in-house JavaScript code sharing. Tuesday, 12/17 at 10am PT/1pm ET.Sign up here »

redux-saga-firebase

0.15.0 • Public • Published

redux-saga-firebase

CircleCI npm version Coverage Status Known Vulnerabilities

A redux-saga integration for firebase.

Quick start

Install with:

yarn add redux-saga-firebase

Initialize a firebase app and instantiate redux-saga-firebase:

import firebase from 'firebase'
import '@firebase/firestore' // 👈 If you're using firestore
import ReduxSagaFirebase from 'redux-saga-firebase'
 
const myFirebaseApp = firebase.initializeApp({
  apiKey: 'qosjdqsdkqpdqldkqdkfojqjpfk',
  authDomain: 'my-app.firebaseapp.com',
  databaseURL: 'https://my-app.firebaseio.com',
})
 
const reduxSagaFirebase = new ReduxSagaFirebase(myFirebaseApp)

You can now use reduxSagaFirebase methods in your sagas:

function* syncSaga() {
  yield fork(reduxSagaFirebase.database.sync, 'todos', {
    successActionCreator: syncTodos,
  })
}

Make sure your client provides a implementation of fetch, either natively or via a polyfill (whatwg-fetch is a pretty good one).

API

Authentication

Database

Firestore

Functions

Messaging

Storage

Contributing

  • Clone
  • Link lib to example site:
    • yarn link in root directory
    • yarn link redux-saga-firebase in example directory
  • Run tests: yarn test

Keywords

none

Install

npm i redux-saga-firebase

DownloadsWeekly Downloads

4,011

Version

0.15.0

License

MIT

Unpacked Size

288 kB

Total Files

14

Last publish

Collaborators

  • avatar