@ambientlight/bs-rx
Advanced tools
Comparing version 0.1.10 to 0.2.0
{ | ||
"name": "@ambientlight/bs-rx", | ||
"namespace": false, | ||
"version": "0.1.10", | ||
"version": "0.2.0", | ||
"sources": [ | ||
@@ -19,2 +19,3 @@ { | ||
"bs-dependencies": [ | ||
"reason-promise" | ||
], | ||
@@ -21,0 +22,0 @@ "bs-dev-dependencies": [ |
{ | ||
"name": "@ambientlight/bs-rx", | ||
"version": "0.1.10", | ||
"version": "0.2.0", | ||
"description": "bucklescript bindings for RxJs v7", | ||
@@ -34,7 +34,11 @@ "scripts": { | ||
"bs-mocha": "^1.0.0", | ||
"jest": "^24.9.0" | ||
"jest": "^24.9.0", | ||
"reason-promise": "^1.0.2" | ||
}, | ||
"dependencies": { | ||
"rxjs": "^7.0.0-alpha.1" | ||
}, | ||
"peerDependencies": { | ||
"reason-promise": "^1.0.2" | ||
} | ||
} |
@@ -13,8 +13,10 @@ [![STATUS](https://github.com/ambientlight/bs-rx/workflows/Deploy%20Docs/badge.svg)](https://github.com/ambientlight/bs-rx/actions) | ||
``` | ||
npm install @ambientlight/bs-rx | ||
npm install @ambientlight/bs-rx reason-promise | ||
``` | ||
Then add `@ambientlight/bs-rx` into `bs-dependencies` in your project `bsconfig.json`. | ||
[reason-promise](https://github.com/aantron/promise) is a peer dependency | ||
Then add `@ambientlight/bs-rx` (and `reason-promise`) into `bs-dependencies` in your project `bsconfig.json`. | ||
```reason | ||
@@ -58,2 +60,19 @@ Rx.range(~start=1, ~count=200, ()) | ||
## Promises | ||
All bindings accepting promises come in two flavours: as `Js.Promise.t` (shipped with bucklescript) and `Promise.t` from [reason-promise](https://github.com/aantron/promise). For the later, use **\`Repromise** variant constructor. | ||
```reason | ||
[@bs.module "rxjs/operators"] | ||
external mergeMap: ( | ||
[@bs.unwrap] [ | ||
| `Observable(('a, int) => t('b)) | ||
| `Promise(('a, int) => Js.Promise.t('b)) | ||
| `Repromise(('a, int) => Promise.t('b)) | ||
| `Array(('a, int) => array('b)) | ||
], | ||
~concurrent: int=? | ||
) => operator('a, 'b) = "mergeMap"; | ||
``` | ||
## Testing | ||
@@ -114,1 +133,5 @@ | ||
For osx, you can use the npm installation of bsdoc(corresponds to bs-platform 6), but for linux-based distros, you would need to build bsdoc from source for now. | ||
## See Also | ||
[reductive-observable](https://github.com/ambientlight/reductive-observable): Centalized rx side-effects for reductive. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
254077
166
135
2
4