raven-for-redux
Advanced tools
+6
-1
@@ -7,2 +7,5 @@ "use strict"; | ||
| var getUndefined = function getUndefined() {}; | ||
| var getType = function getType(action) { | ||
| return action.type; | ||
| }; | ||
| var filter = function filter() { | ||
@@ -17,2 +20,4 @@ return true; | ||
| breadcrumbDataFromAction = _options$breadcrumbDa === undefined ? getUndefined : _options$breadcrumbDa, | ||
| _options$breadcrumbMe = options.breadcrumbMessageFromAction, | ||
| breadcrumbMessageFromAction = _options$breadcrumbMe === undefined ? getType : _options$breadcrumbMe, | ||
| _options$actionTransf = options.actionTransformer, | ||
@@ -56,3 +61,3 @@ actionTransformer = _options$actionTransf === undefined ? identity : _options$actionTransf, | ||
| category: breadcrumbCategory, | ||
| message: action.type, | ||
| message: breadcrumbMessageFromAction(action), | ||
| data: breadcrumbDataFromAction(action) | ||
@@ -59,0 +64,0 @@ }); |
+3
-3
| { | ||
| "name": "raven-for-redux", | ||
| "version": "1.3.1", | ||
| "version": "1.4.0", | ||
| "description": "Middleware for propagating Redux state/actions to Sentry via Raven.", | ||
@@ -50,3 +50,3 @@ "main": "built/index.js", | ||
| "eslint-plugin-react": "^7.0.1", | ||
| "jest": "^22.0.0", | ||
| "jest": "^23.5.0", | ||
| "prettier": "^1.7.4", | ||
@@ -57,3 +57,3 @@ "raven-js": "^3.12.1", | ||
| "webpack": "^4.0.0", | ||
| "webpack-dev-server": "^2.4.1" | ||
| "webpack-dev-server": "^3.1.2" | ||
| }, | ||
@@ -60,0 +60,0 @@ "jest": { |
+18
-1
@@ -84,2 +84,14 @@ []() []() | ||
| #### `breadcrumbMessageFromAction` _(Function)_ | ||
| Default: `action => action.type` | ||
| `breadcrumbMessageFromAction` allows you to specify a transform function which is passed the `action` object and returns a `string` that will be used as the message of the breadcrumb. | ||
| By default `breadcrumbMessageFromAction` returns `action.type`. | ||
| Finally, be careful not to mutate your `action` within this function. | ||
| See the Sentry [Breadcrumb documentation]. | ||
| #### `breadcrumbDataFromAction` _(Function)_ | ||
@@ -90,3 +102,3 @@ | ||
| Raven allows you to attach additional context information to each breadcrumb | ||
| in the form of a `data` object. `breadcrubmDataFromAction` allows you to specify | ||
| in the form of a `data` object. `breadcrumbDataFromAction` allows you to specify | ||
| a transform function which is passed the `action` object and returns a `data` | ||
@@ -189,2 +201,6 @@ object. Which will be logged to Sentry along with the breadcrumb. | ||
| ### 1.4.0 | ||
| * Add `breadcrumbMessageFromAction` method. ([#98]) | ||
| ### 1.3.1 | ||
@@ -237,1 +253,2 @@ | ||
| [#69]: https://github.com/captbaritone/raven-for-redux/pull/69 | ||
| [#98]: https://github.com/captbaritone/raven-for-redux/pull/98 |
13585
6.58%62
8.77%251
7.26%