Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rxjs-async-map

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxjs-async-map

Map an observable using an async function with a configurable concurreny level, while preserving element order.

  • 0.3.0-preview.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rxjs-async-map

Map an observable using an async function with a configurable concurreny level, while preserving element order.

CircleCI Greenkeeper badge

Installation

rxjs-async-map is available via npm or yarn:

npm i --save rxjs-async-map
yarn add rxjs-async-map

Usage

import { of } from 'rxjs/observable/of';
import { asyncMap } from 'rxjs-async-map';

const myPromise = val =>
  new Promise(resolve => setTimeout(() => resolve(`Result: ${val}`), Math.random() * 1000));

const source = of(1, 2, 3);

// Map over the observable using the async function, while running
// up to two promises concurrently.
//
// The order of elements is preserved, even if the promises resolve
// out-of-order.
const example = source.pipe(asyncMap(myPromise, /* concurrency: */ 2));

/*
  output:
  "Result: 1"
  "Result: 2"
  "Result: 3"
*/
const subscribe = example.subscribe(val => console.log(val));

License

MIT

FAQs

Package last updated on 11 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc