Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

map

import { map } from "https://raw.githubusercontent.com/surma/observables-with-streams/28c55be6d855780c677fd1f4ba975f4d3144891d/src/index.ts";

Returns a Transform with the results of applying the given function to each emitted item of the original observable.

function map<S, T>(f: (x: S) => T | Promise<T>): Transform<S, T>;
§
map<S, T>(f: (x: S) => T | Promise<T>): Transform<S, T>
[src]

§Type Parameters

§Parameters

§
f: (x: S) => T | Promise<T>
[src]

Function called with each emitted item. If it returns a promise, the result is awaited then emitted.

§Return Type

§

Transform that emits items produced by f.