redux-awaiter
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "redux-awaiter", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A Redux middleware for giving opportunities to await and receive actions in anywhere", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -20,3 +20,3 @@ # Redux Awaiter | ||
componentDidMount() { | ||
async componentDidMount() { | ||
const { actions: { fetchUserList } } = this.props; | ||
@@ -99,6 +99,4 @@ fetchUserList(); | ||
`take` receives a pattern as its single argument, and returns a promise. | ||
`take` receives a pattern as its single argument, and returns a Promise which contains the first matching action. | ||
That promise will resolve the first matching action which is dispatched. | ||
```javascript | ||
@@ -111,6 +109,6 @@ const action = await take('RECEIVE_DATA'); // action.type should be RECEIVE_DATA | ||
```typescript | ||
const takeAllOf: <P = {}, M = {}>(patterns: Pattern<P, M>[]) => Promise<Action<P, M>>[]; | ||
const takeAllOf: <P = {}, M = {}>(patterns: Pattern<P, M>[]) => Promise<Action<P, M>[]>; | ||
``` | ||
`takeAllOf` receives an array of patterns as its single argument, and returns an array of promises. | ||
`takeAllOf` receives an array of patterns as its single argument, and returns a Promise which contains an array of actions correspond to patterns. | ||
@@ -131,3 +129,3 @@ Internally, `takeAllOf(patterns)` is the same with `Promise.all(patterns.map(take))`. | ||
`takeOneOf` receives an array of patterns as its single argument, and returns a promise. | ||
`takeOneOf` receives an array of patterns as its single argument, and returns a Promise which contains the first action matched with one of patterns. | ||
@@ -134,0 +132,0 @@ Internally, `takeOneOf(patterns)` is the same with `Promise.race(patterns.map(take))`. |
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
22666
159