redux-polyglot
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -21,2 +21,3 @@ 'use strict'; | ||
var isFunction = is('function'); | ||
var isObject = is('object'); | ||
var isArray = Array.isArray; | ||
@@ -33,2 +34,9 @@ | ||
var getIsValidPolyglotReducer = function getIsValidPolyglotReducer(state) { | ||
return !!(state && isObject(state.polyglot)); | ||
}; | ||
var checkState = function checkState(state) { | ||
if (!getIsValidPolyglotReducer(state)) throw new Error('polyglotReducer : need to be store in "state.polyglot"'); | ||
}; | ||
var createPolyglotMiddleware = exports.createPolyglotMiddleware = function createPolyglotMiddleware(catchedAction, getLocale, getPhrases) { | ||
@@ -39,2 +47,5 @@ checkParams(catchedAction, getLocale, getPhrases); | ||
var dispatch = _ref.dispatch; | ||
var getState = _ref.getState; | ||
checkState(getState()); | ||
return function (next) { | ||
@@ -41,0 +52,0 @@ return function (action) { |
{ | ||
"name": "redux-polyglot", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Tool for using Polyglot.js with Redux", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
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
14629
215