@wordpress/redux-routine
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -1,2 +0,2 @@ | ||
## 3.0.4 (Unreleased) | ||
## 3.1.0 (2019-03-06) | ||
@@ -3,0 +3,0 @@ ### Bug Fixes |
{ | ||
"name": "@wordpress/redux-routine", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Redux middleware for generator coroutines.", | ||
@@ -33,3 +33,3 @@ "author": "The WordPress Contributors", | ||
}, | ||
"gitHead": "80d228669adadb8dfcd24b8421517fed3be2d474" | ||
"gitHead": "1e024a20a20369af7bc9720a676fdd3837a3a105" | ||
} |
@@ -60,6 +60,26 @@ # @wordpress/redux-routine | ||
### `createMiddleware( controls: ?Object )` | ||
<!-- START TOKEN(Autogenerated API docs) --> | ||
Create a Redux middleware, given an object of controls where each key is an action type for which to act upon, the value a function which returns either a promise which is to resolve when evaluation of the action should continue, or a value. The value or resolved promise value is assigned on the return value of the yield assignment. If the control handler returns undefined, the execution is not continued. | ||
### default | ||
[src/index.js#L19-L30](src/index.js#L19-L30) | ||
Creates a Redux middleware, given an object of controls where each key is an | ||
action type for which to act upon, the value a function which returns either | ||
a promise which is to resolve when evaluation of the action should continue, | ||
or a value. The value or resolved promise value is assigned on the return | ||
value of the yield assignment. If the control handler returns undefined, the | ||
execution is not continued. | ||
**Parameters** | ||
- **controls** `Object`: Object of control handlers. | ||
**Returns** | ||
`Function`: Co-routine runtime | ||
<!-- END TOKEN(Autogenerated API docs) --> | ||
## Motivation | ||
@@ -71,5 +91,5 @@ | ||
- **Testability**: Since an action creator yields plain action objects, the behavior of their resolution can be easily substituted in tests. | ||
- **Controlled flexibility**: Control flows can be implemented without sacrificing the expressiveness and intentionality of an action type. Other solutions like thunks or promises promote ultimate flexibility, but at the expense of maintainability manifested through deep coupling between action types and incidental implementation. | ||
- A **common domain language** for expressing data flows: Since controls are centrally defined, it requires the conscious decision on the part of a development team to decide when and how new control handlers are added. | ||
- **Testability**: Since an action creator yields plain action objects, the behavior of their resolution can be easily substituted in tests. | ||
- **Controlled flexibility**: Control flows can be implemented without sacrificing the expressiveness and intentionality of an action type. Other solutions like thunks or promises promote ultimate flexibility, but at the expense of maintainability manifested through deep coupling between action types and incidental implementation. | ||
- A **common domain language** for expressing data flows: Since controls are centrally defined, it requires the conscious decision on the part of a development team to decide when and how new control handlers are added. | ||
@@ -76,0 +96,0 @@ ## Testing |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
129
58249
1