lean-redux
Advanced tools
Comparing version 2.1.1 to 3.0.0
@@ -23,5 +23,5 @@ "use strict"; | ||
var _update = require("lodash/fp/update"); | ||
var _updateWith = require("lodash/fp/updateWith"); | ||
var _update2 = _interopRequireDefault(_update); | ||
var _updateWith2 = _interopRequireDefault(_updateWith); | ||
@@ -112,9 +112,8 @@ var _mapValues = require("lodash/fp/mapValues"); | ||
function createCache() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : plain; | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : plain, | ||
_ref$isEqual = _ref.isEqual, | ||
isEqual = _ref$isEqual === undefined ? _shallowEqual2.default : _ref$isEqual, | ||
_ref$initial = _ref.initial, | ||
initial = _ref$initial === undefined ? plain : _ref$initial; | ||
var _ref$isEqual = _ref.isEqual; | ||
var isEqual = _ref$isEqual === undefined ? _shallowEqual2.default : _ref$isEqual; | ||
var _ref$initial = _ref.initial; | ||
var initial = _ref$initial === undefined ? plain : _ref$initial; | ||
var cache = initial; | ||
@@ -270,6 +269,6 @@ | ||
} | ||
var scope = action.scope; | ||
var initialState = action.initialState; | ||
var update = action.update; | ||
var props = action.props; | ||
var scope = action.scope, | ||
initialState = action.initialState, | ||
update = action.update, | ||
props = action.props; | ||
@@ -288,3 +287,3 @@ | ||
if (!(0, _isEmpty2.default)(scope)) { | ||
return (0, _update2.default)(disableLodashPath(scope), doUpdate, state); | ||
return (0, _updateWith2.default)(Object, disableLodashPath(scope), doUpdate, state); | ||
} | ||
@@ -291,0 +290,0 @@ |
{ | ||
"name": "lean-redux", | ||
"description": "Redux state like local component state", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"main": "lib/lean.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -11,8 +11,8 @@ | ||
component local state | ||
- No need to create action types, reducers or even action creators | ||
- Nearly the same API with React Components! | ||
- Redux state can be scoped to the components | ||
- No need to manually create action types or reducers | ||
- The same API with React Components! Use `this.setState()` to update Redux state | ||
- Redux state is be scoped to the components | ||
- Component cannot interfere with parts of the state that do not belong to it | ||
- Play well with other tools in the Redux community | ||
- Time travel debuggers, Redux Form etc. work well with Lean Redux | ||
- Time travel debuggers, state serialization tools, Redux Form etc. work well with Lean Redux | ||
- You can drop this into your existing project and start using it only for | ||
@@ -101,6 +101,7 @@ parts of the app | ||
- `scope: string|Array|Function` Scope the component to a part of the Redux | ||
state. Deep scopes can be defined with arrays. If a function it should return | ||
the final scope. Parent component props are passed to the function. If | ||
`scope` is passed as a prop from the parent component it will override the | ||
value defined here unless it's a function. | ||
state. Deep scopes can be defined with arrays. Missing path values in the | ||
state will be automatically created as objects. If the value is a function it | ||
should return the final scope. Parent component props are passed to the | ||
function. If `scope` is passed as a prop from the parent component it will | ||
override the value defined here unless it's a function. | ||
- `getInitialState(): Object` Create default values for the scoped state. Like | ||
@@ -107,0 +108,0 @@ React component `getInitialState()` this is executed only once when the |
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
16411
128