From f8ae2916086d30b2f5fa23abe21aa19a6baa8e42 Mon Sep 17 00:00:00 2001 From: Omer Levy Date: Thu, 17 Aug 2017 13:56:47 +0300 Subject: [PATCH] add saga registration example --- patterns/listener_reducer.js | 2 +- patterns/remove_reducer.js | 2 +- patterns/sagas_registration.js | 10 ++++++++++ patterns/update_reducer.js | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 patterns/sagas_registration.js diff --git a/patterns/listener_reducer.js b/patterns/listener_reducer.js index 539564d..cfa774f 100644 --- a/patterns/listener_reducer.js +++ b/patterns/listener_reducer.js @@ -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 diff --git a/patterns/remove_reducer.js b/patterns/remove_reducer.js index 4e7d96f..2506ffd 100644 --- a/patterns/remove_reducer.js +++ b/patterns/remove_reducer.js @@ -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 diff --git a/patterns/sagas_registration.js b/patterns/sagas_registration.js new file mode 100644 index 0000000..db9146a --- /dev/null +++ b/patterns/sagas_registration.js @@ -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(), + ]) +} diff --git a/patterns/update_reducer.js b/patterns/update_reducer.js index 3a5ffb4..2eaa515 100644 --- a/patterns/update_reducer.js +++ b/patterns/update_reducer.js @@ -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