All Projects → janryWang → Callbag Map Promise

janryWang / Callbag Map Promise

Callbag map promise

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Callbag Map Promise

Rubico
[a]synchronous functional programming
Stars: ✭ 133 (+107.81%)
Mutual labels:  promise, operator
React Usa Map
React component with all USA States with customizable options. No D3 needed.
Stars: ✭ 63 (-1.56%)
Mutual labels:  map
China geojson
中国行政区划地图数据(省、市、县),geojson格式,可直接用于D3.js,Echarts.js可视化
Stars: ✭ 51 (-20.31%)
Mutual labels:  map
Indoorjs
Indoor mapping for floorplans using on fabricjs
Stars: ✭ 59 (-7.81%)
Mutual labels:  map
Geotiff.io
Static website for viewing and analyzing GeoTIFF's in the browser
Stars: ✭ 53 (-17.19%)
Mutual labels:  map
React Qmap
💡react腾讯地图开源组件
Stars: ✭ 60 (-6.25%)
Mutual labels:  map
Lenz
Console based MAP 🗺 : with lots of features 🤩
Stars: ✭ 51 (-20.31%)
Mutual labels:  map
Etcd Cluster Operator
A controller to deploy and manage etcd clusters inside of Kubernetes
Stars: ✭ 63 (-1.56%)
Mutual labels:  operator
Euler
Swift Custom Operators for Mathematical Notation
Stars: ✭ 1,123 (+1654.69%)
Mutual labels:  operator
Ws Wrapper
Lightweight WebSocket lib with socket.io-like event handling, requests, and channels
Stars: ✭ 58 (-9.37%)
Mutual labels:  promise
Cdcontainers
Library of data containers and data structures for C programming language.
Stars: ✭ 57 (-10.94%)
Mutual labels:  map
Mapit
An easy way to embed google maps in your site.
Stars: ✭ 54 (-15.62%)
Mutual labels:  map
Sleep Promise
Resolves a promise after a specified delay.
Stars: ✭ 60 (-6.25%)
Mutual labels:  promise
Download
Download and extract files
Stars: ✭ 1,064 (+1562.5%)
Mutual labels:  promise
Mpk Ttss
Improved www.ttss.krakow.pl
Stars: ✭ 63 (-1.56%)
Mutual labels:  map
Pgo
Go library for PHP community with convenient functions
Stars: ✭ 51 (-20.31%)
Mutual labels:  map
Bikedeboa
A (Progressive) Web App to find, map and review bike parkings in the cities of Brazil.
Stars: ✭ 54 (-15.62%)
Mutual labels:  map
Angular1 Async Filter
Angular2 async pipe implemented as Angular 1 filter to handle promises & RxJS observables
Stars: ✭ 59 (-7.81%)
Mutual labels:  promise
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+1662.5%)
Mutual labels:  map
Yux Storage
yux-storage 是一个基于 HTML5 IndexedDB 封装的 Web 本地数据离线存储库
Stars: ✭ 64 (+0%)
Mutual labels:  promise

callbag-map-promise

map + fromPromise + flatten

Install

npm install --save  callbag-map-promise

Usage

import {fromPromise,pipe,forEach} from 'callbag-basics'
import mapPromise from 'callbag-map-promise'
import fetch from 'mfetch'

//no pipeline

pipe(
    fromPromise(
        fetch('/user',...).then(res=>res.json())
    ),
    mapPromise(user=>fetch('/products',{
        data:user
       }).then(res=>res.json())
    ),
    forEach((data)=>{
        console.log(data)
    })
)

//pipeline syntax

fromPromise(fetch('/user',...).then(res=>res.json()))
    |> mapPromise((user)=>fetch('/products',{
        data:user
       }).then(res=>res.json()))
    |> forEach((data)=>{
       console.log(data)
    })

LICENSE

The MIT License (MIT)

Copyright (c) 2018 JanryWang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].