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

zen-observable

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zen-observable - npm Package Compare versions

Comparing version 0.8.13 to 0.8.14

19

lib/extras.js

@@ -55,3 +55,7 @@ 'use strict';

var count = sources.length;
var values = new Map();
var seen = new Set();
var seenAll = false;
var values = sources.map(function () {
return undefined;
});

@@ -61,4 +65,13 @@ var subscriptions = sources.map(function (source, index) {

next: function (v) {
values.set(index, v);
if (values.size === sources.length) observer.next(Array.from(values.values()));
values[index] = v;
if (!seenAll) {
seen.add(index);
if (seen.size !== sources.length) return;
seen = null;
seenAll = true;
}
observer.next(Array.from(values));
},

@@ -65,0 +78,0 @@ error: function (e) {

6

package.json
{
"name": "zen-observable",
"version": "0.8.13",
"version": "0.8.14",
"repository": "zenparsing/zen-observable",

@@ -11,4 +11,4 @@ "description": "An Implementation of ES Observables",

"babel-preset-es2015": "^6.24.1",
"eslint": "^4.16.0",
"mocha": "^5.0.0"
"eslint": "^5.16.0",
"mocha": "^6.1.2"
},

@@ -15,0 +15,0 @@ "dependencies": {},

@@ -35,9 +35,20 @@ import { Observable } from './Observable.js';

let count = sources.length;
let values = new Map();
let seen = new Set();
let seenAll = false;
let values = sources.map(() => undefined);
let subscriptions = sources.map((source, index) => Observable.from(source).subscribe({
next(v) {
values.set(index, v);
if (values.size === sources.length)
observer.next(Array.from(values.values()));
values[index] = v;
if (!seenAll) {
seen.add(index);
if (seen.size !== sources.length)
return;
seen = null;
seenAll = true;
}
observer.next(Array.from(values));
},

@@ -44,0 +55,0 @@ error(e) {

@@ -24,2 +24,21 @@ import assert from 'assert';

});
it('should emit values in the correct order', async () => {
let output = [];
await combineLatest(
parse('-a-b-c-d'),
parse('A-B-C-D')
).forEach(
value => output.push(value.join(''))
);
assert.deepEqual(output, [
'aA',
'aB',
'bB',
'bC',
'cC',
'cD',
'dD',
]);
});
});
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