-
-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Description
When working in Js without Typescript help the lib don't warn you when passing bad values to stream constructor
A classic example is merging or composing null values:
const stream1 = xs.never()
const stream2 = xs.never()
const stream3 = null
xs.merge(stream1, stream2, stream3)
The code don't give error on network setup but only at network run time without telling where the the problem came for.
Would not be bad to add a lite type check on merge and combine, something like
var Merge = /** @class */ (function () {
function Merge(insArr) {
// Are all operand streams?
for (const v of insArr) {
if (!v || !v._add) {
throw Error('Must be a Stream')
}
}
//=================
this.type = 'merge';
this.insArr = insArr;
this.out = NO;
this.ac = 0;
}
Metadata
Metadata
Assignees
Labels
No labels