fp-ts-rxjs
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -16,2 +16,7 @@ # Changelog | ||
# 0.6.3 | ||
- **Bug Fix** | ||
- rewrite es6 imports (@gcanti) | ||
# 0.6.2 | ||
@@ -18,0 +23,0 @@ |
@@ -0,2 +1,9 @@ | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
import * as observable from './Observable'; | ||
export { observable }; | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
observable }; |
@@ -0,3 +1,9 @@ | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
import * as observable from './Observable'; | ||
export { observable }; | ||
//# sourceMappingURL=index.js.map | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
observable }; |
@@ -1,10 +0,13 @@ | ||
import { Alternative1 } from 'fp-ts/lib/Alternative'; | ||
import * as E from 'fp-ts/lib/Either'; | ||
import { Filterable1 } from 'fp-ts/lib/Filterable'; | ||
import { Predicate } from 'fp-ts/lib/function'; | ||
import { Monad1 } from 'fp-ts/lib/Monad'; | ||
import { Monoid } from 'fp-ts/lib/Monoid'; | ||
import * as O from 'fp-ts/lib/Option'; | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
import { Alternative1 } from 'fp-ts/es6/Alternative'; | ||
import * as E from 'fp-ts/es6/Either'; | ||
import { Filterable1 } from 'fp-ts/es6/Filterable'; | ||
import { Predicate } from 'fp-ts/es6/function'; | ||
import { Monad1 } from 'fp-ts/es6/Monad'; | ||
import { Monoid } from 'fp-ts/es6/Monoid'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
import { Observable } from 'rxjs'; | ||
declare module 'fp-ts/lib/HKT' { | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind<A> { | ||
@@ -37,2 +40,58 @@ Observable: Observable<A>; | ||
}, partitionMap: <A, B, C>(f: (a: A) => E.Either<B, C>) => (fa: Observable<A>) => import("fp-ts/lib/Compactable").Separated<Observable<B>, Observable<C>>, separate: <A, B>(fa: Observable<E.Either<A, B>>) => import("fp-ts/lib/Compactable").Separated<Observable<A>, Observable<B>>; | ||
export { alt, ap, apFirst, apSecond, chain, chainFirst, compact, filter, filterMap, flatten, map, partition, partitionMap, separate }; | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
ap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chain, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chainFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
flatten, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
map, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
separate }; |
@@ -1,5 +0,5 @@ | ||
import * as E from 'fp-ts/lib/Either'; | ||
import { identity } from 'fp-ts/lib/function'; | ||
import * as O from 'fp-ts/lib/Option'; | ||
import { pipe, pipeable } from 'fp-ts/lib/pipeable'; | ||
import * as E from 'fp-ts/es6/Either'; | ||
import { identity } from 'fp-ts/es6/function'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
import { pipe, pipeable } from 'fp-ts/es6/pipeable'; | ||
import { combineLatest, EMPTY, merge, of } from 'rxjs'; | ||
@@ -10,3 +10,3 @@ import { map as rxMap, mergeMap } from 'rxjs/operators'; | ||
*/ | ||
export var URI = 'Observable'; | ||
export const URI = 'Observable'; | ||
/** | ||
@@ -17,3 +17,3 @@ * @since 0.6.0 | ||
return { | ||
concat: function (x, y) { return merge(x, y); }, | ||
concat: (x, y) => merge(x, y), | ||
empty: EMPTY | ||
@@ -25,35 +25,79 @@ }; | ||
*/ | ||
export var observable = { | ||
URI: URI, | ||
map: function (fa, f) { return fa.pipe(rxMap(f)); }, | ||
of: of, | ||
ap: function (fab, fa) { return combineLatest([fab, fa]).pipe(rxMap(function (_a) { | ||
var f = _a[0], a = _a[1]; | ||
return f(a); | ||
})); }, | ||
chain: function (fa, f) { return fa.pipe(mergeMap(f)); }, | ||
zero: function () { return EMPTY; }, | ||
alt: function (fx, f) { return merge(fx, f()); }, | ||
compact: function (fa) { return observable.filterMap(fa, identity); }, | ||
separate: function (fa) { return observable.partitionMap(fa, identity); }, | ||
partitionMap: function (fa, f) { return ({ | ||
left: observable.filterMap(fa, function (a) { | ||
return pipe(f(a), E.fold(O.some, function () { return O.none; })); | ||
}), | ||
right: observable.filterMap(fa, function (a) { | ||
return pipe(f(a), E.fold(function () { return O.none; }, O.some)); | ||
}) | ||
}); }, | ||
partition: function (fa, p) { return observable.partitionMap(fa, E.fromPredicate(p, identity)); }, | ||
filterMap: function (fa, f) { | ||
return fa.pipe(mergeMap(function (a) { | ||
return pipe(f(a), | ||
// tslint:disable-next-line: deprecation | ||
O.fold(function () { return EMPTY; }, of)); | ||
})); | ||
}, | ||
filter: function (fa, p) { return observable.filterMap(fa, O.fromPredicate(p)); } | ||
export const observable = { | ||
URI, | ||
map: (fa, f) => fa.pipe(rxMap(f)), | ||
of, | ||
ap: (fab, fa) => combineLatest([fab, fa]).pipe(rxMap(([f, a]) => f(a))), | ||
chain: (fa, f) => fa.pipe(mergeMap(f)), | ||
zero: () => EMPTY, | ||
alt: (fx, f) => merge(fx, f()), | ||
compact: fa => observable.filterMap(fa, identity), | ||
separate: fa => observable.partitionMap(fa, identity), | ||
partitionMap: (fa, f) => ({ | ||
left: observable.filterMap(fa, a => pipe(f(a), E.fold(O.some, () => O.none))), | ||
right: observable.filterMap(fa, a => pipe(f(a), E.fold(() => O.none, O.some))) | ||
}), | ||
partition: (fa, p) => observable.partitionMap(fa, E.fromPredicate(p, identity)), | ||
filterMap: (fa, f) => fa.pipe(mergeMap(a => pipe(f(a), | ||
// tslint:disable-next-line: deprecation | ||
O.fold(() => EMPTY, of)))), | ||
filter: (fa, p) => observable.filterMap(fa, O.fromPredicate(p)) | ||
}; | ||
var _a = pipeable(observable), alt = _a.alt, ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, chain = _a.chain, chainFirst = _a.chainFirst, compact = _a.compact, filter = _a.filter, filterMap = _a.filterMap, flatten = _a.flatten, map = _a.map, partition = _a.partition, partitionMap = _a.partitionMap, separate = _a.separate; | ||
export { alt, ap, apFirst, apSecond, chain, chainFirst, compact, filter, filterMap, flatten, map, partition, partitionMap, separate }; | ||
//# sourceMappingURL=Observable.js.map | ||
const { alt, ap, apFirst, apSecond, chain, chainFirst, compact, filter, filterMap, flatten, map, partition, partitionMap, separate } = pipeable(observable); | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
ap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chain, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chainFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
flatten, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
map, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
separate }; |
@@ -0,2 +1,9 @@ | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
import * as observable from './Observable'; | ||
export { observable }; | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
observable }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
var observable = require("./Observable"); | ||
exports.observable = observable; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
import { Alternative1 } from 'fp-ts/lib/Alternative'; | ||
@@ -37,2 +40,58 @@ import * as E from 'fp-ts/lib/Either'; | ||
}, partitionMap: <A, B, C>(f: (a: A) => E.Either<B, C>) => (fa: Observable<A>) => import("fp-ts/lib/Compactable").Separated<Observable<B>, Observable<C>>, separate: <A, B>(fa: Observable<E.Either<A, B>>) => import("fp-ts/lib/Compactable").Separated<Observable<A>, Observable<B>>; | ||
export { alt, ap, apFirst, apSecond, chain, chainFirst, compact, filter, filterMap, flatten, map, partition, partitionMap, separate }; | ||
export { | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
ap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chain, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
chainFirst, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
flatten, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
map, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.0 | ||
*/ | ||
separate }; |
@@ -72,2 +72,1 @@ "use strict"; | ||
exports.separate = separate; | ||
//# sourceMappingURL=Observable.js.map |
{ | ||
"name": "fp-ts-rxjs", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "fp-ts bindings for RxJS", | ||
@@ -13,3 +13,3 @@ "files": [ | ||
"scripts": { | ||
"lint": "tslint -p tsconfig.tslint.json src/**/*.ts test/**/*.ts", | ||
"lint": "tslint -p .", | ||
"prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"", | ||
@@ -20,5 +20,7 @@ "fix-prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --write \"{src,test}/**/*.ts\"", | ||
"clean": "rm -rf lib/* es6/*", | ||
"build": "npm run clean && tsc && tsc -p ./tsconfig.es6.json", | ||
"prebuild": "npm run clean", | ||
"build": "tsc -p ./tsconfig.build.json && tsc -p ./tsconfig.build-es6.json", | ||
"prepublish": "npm run build", | ||
"docs": "docs-ts" | ||
"docs": "docs-ts", | ||
"postbuild": "import-path-rewrite" | ||
}, | ||
@@ -42,7 +44,8 @@ "repository": { | ||
"@types/node": "7.0.4", | ||
"docs-ts": "^0.1.0", | ||
"docs-ts": "^0.3.0", | ||
"fp-ts": "^2.0.1", | ||
"import-path-rewrite": "github:gcanti/import-path-rewrite", | ||
"jest": "^24.8.0", | ||
"mocha": "^5.2.0", | ||
"prettier": "^1.18.2", | ||
"prettier": "^1.19.1", | ||
"rxjs": "^6.5.2", | ||
@@ -49,0 +52,0 @@ "ts-jest": "^24.0.2", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
400
15950
14
12
1