@ambientlight/bs-rx
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "@ambientlight/bs-rx", | ||
"namespace": false, | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"sources": [ | ||
@@ -19,3 +19,4 @@ { | ||
"bs-dependencies": [ | ||
"reason-promise" | ||
"reason-promise", | ||
"bs-fetch" | ||
], | ||
@@ -22,0 +23,0 @@ "bs-dev-dependencies": [ |
{ | ||
"name": "@ambientlight/bs-rx", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "bucklescript bindings for RxJs v7", | ||
@@ -33,2 +33,3 @@ "scripts": { | ||
"@glennsl/bs-jest": "^0.4.9", | ||
"bs-fetch": "^0.5.1", | ||
"bs-mocha": "^1.0.0", | ||
@@ -42,4 +43,5 @@ "jest": "^24.9.0", | ||
"peerDependencies": { | ||
"reason-promise": "^1.0.2" | ||
"reason-promise": "^1.0.2", | ||
"bs-fetch": "^0.5.1" | ||
} | ||
} |
@@ -8,3 +8,3 @@ [![STATUS](https://github.com/ambientlight/bs-rx/workflows/Deploy%20Docs/badge.svg)](https://github.com/ambientlight/bs-rx/actions) | ||
Bucklescript bindings for [rxjs v7(alpha)](https://github.com/ReactiveX/rxjs) | ||
Most functionality is available, while ajax / fetch / websocket apis are not yet done. Refer to [documentation](https://ambientlight.github.io/bs-rx) for existing coverage. | ||
Most functionality is available, while ajax / websocket apis are not yet done. Refer to [documentation](https://ambientlight.github.io/bs-rx) for existing coverage. | ||
@@ -58,2 +58,14 @@ ## Installation and Usage | ||
#### Fetch | ||
```reason | ||
fromFetch(`String("https://api.github.com/users?per_page=5"), ()) | ||
|> Rx.Operators.mergeMap(`Promise((response, _idx) => response |> Fetch.Response.json)) | ||
|> Rx.Observable.subscribe( | ||
~next=value => Js.log(value), | ||
~error=error=>Js.log(error), | ||
~complete=() => Js.log("done") | ||
); | ||
``` | ||
Also, have a look at [OperatorTests](https://github.com/ambientlight/bs-rx/blob/master/__tests__/OperatorTests.re) for more usage examples. | ||
@@ -60,0 +72,0 @@ |
Sorry, the diff of this file is not supported yet
255043
167
147
3
5