Skip to content

Commit 25d8d8a

Browse files
committed
better logging
1 parent dbdeb31 commit 25d8d8a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: mobile/ReactNativeTutorial/app/bundles/comments/sagas/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { call, put } from 'redux-saga/effects';
33

44
import { actions as reduxActions } from '../../../reducers'
55

6-
const FETCH = 'COMMENTS:FETCH';
7-
const UPDATE_FORM = 'COMMENTS:UPDATE_FORM';
6+
const FETCH = 'SAGA:COMMENTS:FETCH';
7+
const UPDATE_FORM = 'SAGA:COMMENTS:UPDATE_FORM';
88

99
function* fetchHandler() {
1010
// try {
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
export default function logger({ getState }) {
22
return next => action => {
3-
console.info('will dispatch action', action);
3+
if (/^SAGA/i.test(action.type)) {
4+
console.info(`Executing saga action %c${action.type}`, 'color: #0C0CD6');
5+
return next(action);
6+
}
7+
console.info('Executing redux action', action);
48
const result = next(action);
59
const state = getState();
6-
console.info('state after dispatch', state.toJS());
10+
console.info('State after dispatch', state.toJS());
711
return result;
812
};
913
}

0 commit comments

Comments
 (0)