|
@@ -4,15 +4,15 @@
|
|
|
|
|
|
### `subReducer(key, reducer, additionalKey, ...)`
|
|
|
|
|
|
-Creates a wrapper reducer that call `reducer`
|
|
|
-on the substate specified by `key`.
|
|
|
+Creates a wrapper reducer that calls `reducer`
|
|
|
+on the sub-state specified by `key`.
|
|
|
You may use dot notation.
|
|
|
Rest of the state is left untouched.
|
|
|
|
|
|
```js
|
|
|
const r = subReducer("persons", personReducer);
|
|
|
|
|
|
- r({persons: ["John", "Jill"], cars: ["Honda"]}, cityon);
|
|
|
+ r({persons: ["John", "Jill"], cars: ["Honda"]}, action);
|
|
|
// => {
|
|
|
// persons: personReducer(["John", "Jill"], action),
|
|
|
// cars: ["Honda"]
|
|
@@ -64,13 +64,13 @@ Useful to "concatenate" a few `subReducer`s. like:
|
|
|
|
|
|
### `cowValueModel(key, ...)`
|
|
|
|
|
|
-Creates an object with set of functions allowing
|
|
|
+Creates an overloaded function allowing
|
|
|
to set or get specified key from any object.
|
|
|
Get when one arg, set when two args.
|
|
|
Specify keys by passing a list of keys to `cowValueModel`.
|
|
|
You can use dot notation.
|
|
|
|
|
|
-Setting return a copy with specified (sub-)property changed;
|
|
|
+Set-usage (two-arg) returns a copy with specified (sub-)property changed;
|
|
|
in case no change actually happens, returns the original object.
|
|
|
|
|
|
```js
|
|
@@ -111,7 +111,7 @@ to access `obj.person[34].name` with `c(obj)` / `c(obj, val)`.
|
|
|
|
|
|
### `typedAction(type, fn)`
|
|
|
|
|
|
-This creates an action creator function that amend existing `fn` by:
|
|
|
+This creates an action creator function that amends existing `fn` by:
|
|
|
- adding a `type` property to the result, as well as
|
|
|
- adding a `TYPE` property to action creator itself.
|
|
|
|