react-intl-redux
Advanced tools
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _warning = require('warning'); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,2 +26,10 @@ | ||
var mapStateToProps = function mapStateToProps(state) { | ||
var intl = state.intl; | ||
return _extends({}, intl); | ||
}; | ||
var ConnectedIntlProvider = (0, _reactRedux.connect)(mapStateToProps)(_reactIntl.IntlProvider); | ||
var Provider = function Provider(_ref) { | ||
@@ -28,6 +40,7 @@ var store = _ref.store; | ||
(0, _warning2.default)(props.locale || props.messages, '[react-intl-redux] pass `locale` and `messages` is deprecated, please set them in `initalState` instead. https://github.com/ratson/react-intl-redux/issues/4'); // eslint-disable-line | ||
return _react2.default.createElement( | ||
_reactRedux.Provider, | ||
{ store: store }, | ||
_react2.default.createElement(_reactIntl.IntlProvider, props) | ||
_react2.default.createElement(ConnectedIntlProvider, props) | ||
); | ||
@@ -41,8 +54,2 @@ }; | ||
var mapStateToProps = function mapStateToProps(state) { | ||
var intl = state.intl; | ||
return _extends({}, intl); | ||
}; | ||
exports.default = (0, _reactRedux.connect)(mapStateToProps)(Provider); | ||
exports.default = Provider; |
{ | ||
"name": "react-intl-redux", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Redux binding for React Intl", | ||
@@ -16,30 +16,31 @@ "main": "lib/index", | ||
"react-redux": "^4.4.5", | ||
"redux": "^3.5.1" | ||
"redux": "^3.5.1", | ||
"warning": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.7.7", | ||
"babel-eslint": "^6.0.3", | ||
"babel-plugin-check-es2015-constants": "^6.7.2", | ||
"babel-plugin-syntax-jsx": "^6.5.0", | ||
"babel-plugin-transform-es2015-arrow-functions": "^6.7.7", | ||
"babel-plugin-transform-es2015-block-scoped-functions": "^6.6.5", | ||
"babel-plugin-transform-es2015-block-scoping": "^6.7.1", | ||
"babel-plugin-transform-es2015-destructuring": "^6.6.5", | ||
"babel-plugin-transform-es2015-function-name": "^6.5.0", | ||
"babel-plugin-transform-es2015-literals": "^6.5.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.7.7", | ||
"babel-plugin-transform-es2015-parameters": "^6.7.0", | ||
"babel-plugin-transform-es2015-shorthand-properties": "^6.5.0", | ||
"babel-plugin-transform-es2015-spread": "^6.6.5", | ||
"babel-plugin-transform-export-extensions": "^6.5.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.6.5", | ||
"babel-plugin-transform-react-jsx": "^6.7.5", | ||
"babel-register": "^6.7.2", | ||
"eslint": "^2.8.0", | ||
"eslint-plugin-react": "^5.0.1", | ||
"babel-cli": "^6.9.0", | ||
"babel-eslint": "^6.0.4", | ||
"babel-plugin-check-es2015-constants": "^6.8.0", | ||
"babel-plugin-syntax-jsx": "^6.8.0", | ||
"babel-plugin-transform-es2015-arrow-functions": "^6.8.0", | ||
"babel-plugin-transform-es2015-block-scoped-functions": "^6.8.0", | ||
"babel-plugin-transform-es2015-block-scoping": "^6.9.0", | ||
"babel-plugin-transform-es2015-destructuring": "^6.9.0", | ||
"babel-plugin-transform-es2015-function-name": "^6.9.0", | ||
"babel-plugin-transform-es2015-literals": "^6.8.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.8.0", | ||
"babel-plugin-transform-es2015-parameters": "^6.9.0", | ||
"babel-plugin-transform-es2015-shorthand-properties": "^6.8.0", | ||
"babel-plugin-transform-es2015-spread": "^6.8.0", | ||
"babel-plugin-transform-export-extensions": "^6.8.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.8.0", | ||
"babel-plugin-transform-react-jsx": "^6.8.0", | ||
"babel-register": "^6.9.0", | ||
"eslint": "^2.10.2", | ||
"eslint-plugin-react": "^5.1.1", | ||
"mocha": "^2.4.5", | ||
"npm-run-all": "^1.7.0", | ||
"react": "^15.0.1", | ||
"npm-run-all": "^2.1.1", | ||
"react": "^15.1.0", | ||
"rimraf": "^2.5.2", | ||
"should": "^8.3.1" | ||
"should": "^8.4.0" | ||
}, | ||
@@ -46,0 +47,0 @@ "repository": "ratson/react-intl-redux", |
import {connect, Provider as ReduxProvider} from 'react-redux' | ||
import {IntlProvider} from 'react-intl' | ||
import React, {PropTypes} from 'react' | ||
import warning from 'warning' | ||
const mapStateToProps = (state) => { | ||
const {intl} = state | ||
return { | ||
...intl, | ||
} | ||
} | ||
const ConnectedIntlProvider = connect(mapStateToProps)(IntlProvider) | ||
const Provider = ({store, ...props}) => { | ||
warning(props.locale || props.messages, '[react-intl-redux] pass `locale` and `messages` is deprecated, please set them in `initalState` instead. https://github.com/ratson/react-intl-redux/issues/4') // eslint-disable-line | ||
return ( | ||
<ReduxProvider store={store}> | ||
<IntlProvider {...props} /> | ||
<ConnectedIntlProvider {...props} /> | ||
</ReduxProvider> | ||
@@ -18,9 +29,2 @@ ) | ||
const mapStateToProps = (state) => { | ||
const {intl} = state | ||
return { | ||
...intl, | ||
} | ||
} | ||
export default connect(mapStateToProps)(Provider) | ||
export default Provider |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
105
7.14%6241
-7.7%4
33.33%5
-16.67%1
Infinity%0
-100%2
100%