remote-redux-devtools
Advanced tools
Comparing version 0.3.3-alpha1 to 0.3.3-alpha2
@@ -128,5 +128,11 @@ 'use strict'; | ||
function async(fn) { | ||
setTimeout(fn, 0); | ||
} | ||
function sendError(errorAction) { | ||
store.dispatch(errorAction); | ||
if (!started) send(); | ||
async(function () { | ||
store.dispatch(errorAction); | ||
if (!started) send(); | ||
}); | ||
} | ||
@@ -151,5 +157,11 @@ | ||
console.error = function () { | ||
var message = arguments[0]; | ||
var stack = message && message.stack; | ||
sendError({ type: ERROR, message: message, stack: stack }); | ||
var errorAction = { type: ERROR }; | ||
var error = arguments[0]; | ||
errorAction.message = error.message ? error.message : error; | ||
if (error.sourceURL) { | ||
errorAction = _extends({}, errorAction, { sourceURL: error.sourceURL, line: error.line, column: error.column | ||
}); | ||
} | ||
if (error.stack) errorAction.stack = error.stack; | ||
sendError(errorAction); | ||
console.beforeRemotedev.apply(null, arguments); | ||
@@ -220,6 +232,2 @@ }; | ||
function async(fn) { | ||
setTimeout(fn, 0); | ||
} | ||
function checkForReducerErrors() { | ||
@@ -269,3 +277,3 @@ var liftedState = arguments.length <= 0 || arguments[0] === undefined ? store.liftedStore.getState() : arguments[0]; | ||
var realtime = typeof options.realtime === 'undefined' ? process.env.NODE_ENV === 'development' : options.realtime; | ||
if (!realtime && !startOn) return function (f) { | ||
if (!realtime && !(startOn || sendOn || sendOnError)) return function (f) { | ||
return f; | ||
@@ -272,0 +280,0 @@ }; |
{ | ||
"name": "remote-redux-devtools", | ||
"version": "0.3.3-alpha1", | ||
"version": "0.3.3-alpha2", | ||
"description": "Relay Redux actions to remote Redux DevTools.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -72,3 +72,3 @@ Remote Redux DevTools | ||
`sendOn` | *String* or *Array of strings* indicating an action or a list of actions, which should trigger sending the history to the monitor (without starting it). *Note*: when using it, add a `fetch` polyfill if needed. | ||
`sendOnError` | *Numeric* code: `0` - disabled (default), `1` - send all uncaught exception messages (for browser and React Native), `2` - send only reducers error messages. | ||
`sendOnError` | *Numeric* code: `0` - disabled (default), `1` - send all uncaught exception messages, `2` - send only reducers error messages. | ||
`sendTo` | *String* url of the monitor to send the history when `sendOn` is triggered. By default is `${secure ? 'https' : 'http'}://${hostname}:${port}`. | ||
@@ -75,0 +75,0 @@ `id` | *String* to identify the instance when sending the history triggered by `sendOn`. You can use, for example, user id here, to know who sent the data. |
18431
265