🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@wordpress/redux-routine

Package Overview
Dependencies
Maintainers
9
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/redux-routine - npm Package Compare versions

Comparing version

to
3.2.0

2

CHANGELOG.md

@@ -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