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.2 to 0.0.3

43

es/awaiters.js
"use strict";
export class Awaiters {
constructor() {
var Awaiters = (function () {
function Awaiters() {
this.awaiters = [];
}
static get Instance() {
return this.instance;
}
static consumer(action) {
return ({ pattern, resolve }) => {
const isMatch = ((action, pattern) => {
const { type } = action;
Object.defineProperty(Awaiters, "Instance", {
get: function () {
return this.instance;
},
enumerable: true,
configurable: true
});
Awaiters.consumer = function (action) {
return function (_a) {
var pattern = _a.pattern, resolve = _a.resolve;
var isMatch = (function (action, pattern) {
var type = action.type;
if (typeof pattern === 'string') {

@@ -27,13 +32,15 @@ return type === pattern;

};
}
produce(awaiter) {
this.awaiters = [...this.awaiters, awaiter];
}
consume(action) {
};
Awaiters.prototype.produce = function (awaiter) {
this.awaiters = this.awaiters.concat([awaiter]);
};
Awaiters.prototype.consume = function (action) {
this.awaiters = this.awaiters.filter(Awaiters.consumer(action));
}
}
Awaiters.instance = new Awaiters();
const awaiters = Awaiters.Instance;
};
Awaiters.instance = new Awaiters();
return Awaiters;
}());
export { Awaiters };
var awaiters = Awaiters.Instance;
export default awaiters;
//# sourceMappingURL=awaiters.js.map
"use strict";
import awaiters from './awaiters';
export const createAwaiterMiddleware = () => () => next => (action) => {
export var createAwaiterMiddleware = function () { return function () { return function (next) { return function (action) {
awaiters.consume(action);
return next(action);
};
}; }; }; };
export * from './awaiters';
export * from './operations';
//# sourceMappingURL=index.js.map
"use strict";
import awaiters from '../awaiters';
export const take = (pattern) => new Promise(resolve => awaiters.produce({ pattern, resolve }));
export var take = function (pattern) {
return new Promise(function (resolve) { return awaiters.produce({ pattern: pattern, resolve: resolve }); });
};
//# sourceMappingURL=take.js.map
"use strict";
import { take } from './';
export const takeAllOf = (patterns) => Promise.all(patterns.map(take));
export var takeAllOf = function (patterns) {
return Promise.all(patterns.map(take));
};
//# sourceMappingURL=takeAllOf.js.map
"use strict";
import { take } from './';
export const takeOneOf = (patterns) => Promise.race(patterns.map(take));
export var takeOneOf = function (patterns) {
return Promise.race(patterns.map(take));
};
//# sourceMappingURL=takeOneOf.js.map
{
"name": "redux-awaiter",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Redux middleware for giving opportunities to await and receive actions in anywhere",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

"build:es": "tsc --outDir es -d",
"build:commonjs": "tsc -m commonjs --target es5 --outDir lib",
"build:commonjs": "tsc -m commonjs --outDir lib",
"build": "npm run build:es && npm run build:commonjs",

@@ -24,0 +24,0 @@ "prepare": "npm run clean && npm run lint && npm run build"

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

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