Skip to content

Commit

Permalink
add saga registration example
Browse files Browse the repository at this point in the history
  • Loading branch information
omer88 committed Aug 17, 2017
1 parent 8831963 commit f8ae291
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion patterns/listener_reducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as types from './types'
import { metaTypes } from './types'
...
//...

[types.firebase.FIREBASE_LISTEN_REQUESTED](state, action) {
const property = action.meta.type
Expand Down
2 changes: 1 addition & 1 deletion patterns/remove_reducer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as types from './types'
import { metaTypes } from './types'

...
//...

[types.firebase.FIREBASE_REMOVE_REQUESTED](state, action) {
const property = action.meta.type
Expand Down
10 changes: 10 additions & 0 deletions patterns/sagas_registration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import metaTypes from './types'
import sagas from './sagas'
import { all } from 'redux-saga/effects'

export default function* rootSaga() {
yield all([
sagas.watchListener(metaTypes.userContacts),
sagas.watchUpdateRequested(),
])
}
2 changes: 1 addition & 1 deletion patterns/update_reducer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as types from './types'
import { metaTypes } from './types'

...
//...

[types.firebase.FIREBASE_UPDATE_REQUESTED](state, action) {
const property = action.meta.type
Expand Down

0 comments on commit f8ae291

Please sign in to comment.