Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (47 sloc) 2.43 KB

This is RxJS v 4. Find the latest version here

Rx.Observable.prototype.let(func)

Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.

This operator allows for a fluent style of writing queries that use the same sequence multiple times. There is an alias of letBind for browsers older than IE 9.

Arguments

  1. func (Function): Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.

Returns

(Observable): An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Example

var obs = Rx.Observable.range(1, 3);

var source = obs.let(function (o) { return o.concat(o); });

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

// => Next: 1
// => Next: 2
// => Next: 3
// => Next: 1
// => Next: 2
// => Next: 3
// => Completed

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests:

You can’t perform that action at this time.