electron-redux
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -20,3 +20,3 @@ 'use strict'; | ||
if (!(0, _fluxStandardAction.isFSA)(action)) { | ||
log('Action not FSA-compliant', action); | ||
log('WARNING! Action not FSA-compliant', action); | ||
@@ -23,0 +23,0 @@ return false; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _validateAction = require('../../helpers/validateAction'); | ||
var _validateAction2 = _interopRequireDefault(_validateAction); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -15,2 +19,18 @@ | ||
describe('forwardToMain', function () { | ||
beforeEach(function () { | ||
_validateAction2.default.mockReturnValue(true); | ||
}); | ||
it('should pass an action through if it doesn\'t pass validation (FSA)', function () { | ||
var next = jest.fn(); | ||
// thunk action | ||
var action = function action() {}; | ||
_validateAction2.default.mockReturnValue(false); | ||
(0, _forwardToMain2.default)()(next)(action); | ||
expect(next).toHaveBeenCalledTimes(1); | ||
expect(next).toHaveBeenCalledWith(action); | ||
}); | ||
it('should pass an action through if it starts with @@', function () { | ||
@@ -17,0 +37,0 @@ var next = jest.fn(); |
@@ -19,2 +19,4 @@ 'use strict'; | ||
// eslint-disable-line no-unused-vars | ||
console.log('##### forwardToMain', action); | ||
// return next(action); | ||
if (!(0, _validateAction2.default)(action)) return next(action); | ||
@@ -21,0 +23,0 @@ |
@@ -20,2 +20,3 @@ 'use strict'; | ||
return function (action) { | ||
console.log('##### forwardToRenderer', action); | ||
if (!(0, _validateAction2.default)(action)) return next(action); | ||
@@ -22,0 +23,0 @@ |
{ | ||
"name": "electron-redux", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Use redux in the main and browser process in electron", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -87,5 +87,5 @@ # electron-redux | ||
Actions fired *HAVE TO* be [FSA](https://github.com/acdlite/flux-standard-action#example)-compliant, i.e. have a `type` and `payload` property. Any actions not passing this test will be ignored and simply passed through to the next middleware. | ||
Actions fired **HAVE TO** be [FSA](https://github.com/acdlite/flux-standard-action#example)-compliant, i.e. have a `type` and `payload` property. Any actions not passing this test will be ignored and simply passed through to the next middleware. | ||
*NB: `redux-thunk` is not FSA-compliant out of the box, but can still produce compatible actions once the async action fires.* | ||
> NB: `redux-thunk` is not FSA-compliant out of the box, but can still produce compatible actions once the async action fires. | ||
@@ -92,0 +92,0 @@ ### Local actions (renderer process) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373870
87
1098