Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-awaiter

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-awaiter - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"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))`.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc