You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Takes a boolean or optionally a function that receives `getState` function for accessing current store state and `action` object as parameters. Returns `true` if the log group should be collapsed, `false` otherwise.
If specified this function will be called before each action is processed with this middleware.
46
+
Receives `getState` function for accessing current store state and `action` object as parameters. Returns `true` if action should be logged, `false` otherwise.
47
+
48
+
*Default: `null` (always log)*
43
49
44
50
#### __duration (Boolean)__
45
51
Print duration of each action?
46
52
47
53
*Default: `false`*
48
54
55
+
#### __timestamp (Boolean)__
56
+
Print timestamp with each action?
57
+
58
+
*Default: `true`*
59
+
49
60
#### __transformer (Function)__
50
61
Transform state before print. Eg. convert Immutable object to plain JSON.
If specified this function will be called before each action is processed with this middleware.
56
-
Receives `getState` function for accessing current store state and `action` object as parameters. Returns `true` if action should be logged, `false` otherwise.
65
+
#### __actionTransformer (Function)__
66
+
Transform action before print. Eg. convert Immutable object to plain JSON.
Takes a boolean or optionally a function that receives `getState` function for accessing current store state and `action` object as parameters. Returns `true` if the log group should be collapsed, `false` otherwise.
62
-
63
-
*Default: `false`*
68
+
*Default: identity function*
64
69
65
-
#####Examples:
66
-
######log only in dev mode
70
+
### Examples:
71
+
#### log only in dev mode
67
72
```javascript
68
73
const__DEV__=true;
69
74
@@ -72,28 +77,28 @@ createLogger({
72
77
});
73
78
```
74
79
75
-
######log everything except actions with type `AUTH_REMOVE_TOKEN`
80
+
#### log everything except actions with type `AUTH_REMOVE_TOKEN`
0 commit comments