Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcandillon/jsoniq-runtime
https://github.com/wcandillon/jsoniq-runtime
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/wcandillon/jsoniq-runtime
- Owner: wcandillon
- Created: 2015-12-24T10:45:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-04T10:41:54.000Z (almost 9 years ago)
- Last Synced: 2024-04-15T00:07:40.748Z (7 months ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Monadic streams for reactive programming
[![Circle CI](https://circleci.com/gh/wcandillon/jsoniq-runtime.svg?style=svg)](https://circleci.com/gh/wcandillon/jsoniq-runtime)
## Examples
```javascript
/* Get stock data somehow */
var source = getStockData();source
.filter(function (quote) {
return quote.price > 30;
})
.map(function (quote) {
return quote.price;
})
.forEach(function (price) {
console.log('Prices higher than $30: $' + price);
});
``````javascript
/* Get stock data somehow */
let source = getAsyncStockData();let subscription = source
.filter(function (quote) {
return quote.price > 30;
})
.map(function (quote) {
return quote.price;
})
.subscribe({
next: price => console.log('Prices higher than $30: $' + price),
throw: err => console.log('Something went wrong: ' + err.message)
});/* When we're done */
subscription.unsubscribe();
```