refract-xstream
Advanced tools
Comparing version 1.0.0-4 to 1.0.0-5
@@ -171,2 +171,19 @@ import xs from 'xstream'; | ||
export { withEffects }; | ||
var identity = function (arg) { return arg; }; | ||
var compose = function () { | ||
var fns = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
fns[_i] = arguments[_i]; | ||
} | ||
if (fns.length === 0) { | ||
return identity; | ||
} | ||
if (fns.length === 1) { | ||
return fns[0]; | ||
} | ||
return function (arg) { | ||
return fns.reduceRight(function (previousResult, fn) { return fn(previousResult); }, arg); | ||
}; | ||
}; | ||
export { withEffects, compose }; |
18
index.js
@@ -177,2 +177,20 @@ 'use strict'; | ||
var identity = function (arg) { return arg; }; | ||
var compose = function () { | ||
var fns = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
fns[_i] = arguments[_i]; | ||
} | ||
if (fns.length === 0) { | ||
return identity; | ||
} | ||
if (fns.length === 1) { | ||
return fns[0]; | ||
} | ||
return function (arg) { | ||
return fns.reduceRight(function (previousResult, fn) { return fn(previousResult); }, arg); | ||
}; | ||
}; | ||
exports.withEffects = withEffects; | ||
exports.compose = compose; |
{ | ||
"name": "refract-xstream", | ||
"version": "1.0.0-4", | ||
"version": "1.0.0-5", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "jsnext:main": "index.es.js", |
import { withEffects } from './withEffects' | ||
import { ObservableComponent, Aperture } from './observable' | ||
import { ErrorHandler, Handler, ObserveOptions } from './baseTypes' | ||
import { compose, Compose } from './compose' | ||
@@ -11,3 +12,5 @@ export { | ||
ErrorHandler, | ||
ObserveOptions | ||
ObserveOptions, | ||
compose, | ||
Compose | ||
} |
import { withEffects } from './withEffects' | ||
import { ObservableComponent, Aperture } from './observable' | ||
import { ErrorHandler, Handler, ObserveOptions } from './baseTypes' | ||
import { compose, Compose } from './compose' | ||
export { | ||
@@ -10,3 +11,5 @@ withEffects, | ||
ErrorHandler, | ||
ObserveOptions | ||
ObserveOptions, | ||
compose, | ||
Compose | ||
} |
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
32918
16
842