firebase-saga
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "firebase-saga", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A library for connecting Redux saga middleware to Firebase.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,1 +12,24 @@ # firebase-saga | ||
``` | ||
## Connecting to Sagas | ||
The saga can be like the following: | ||
``` | ||
import { takeEvery } from 'redux-saga'; | ||
import * as actions from '../actions'; | ||
import * as firebaseRef from 'firebase-saga'; | ||
function* fetchPosts() { | ||
const posts = yield call(firebaseRef.get, 'posts'); | ||
if (posts) { | ||
yield put(actions.receivePosts(posts); | ||
} else { | ||
yield put(actions.requestGetPostsFailed()); | ||
} | ||
} | ||
function* get() { | ||
yield* takeEvery(fetchPosts); | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82116
9
2317
35