File: tomap.ts

package info (click to toggle)
node-rx 4.1.0%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 8,992 kB
  • sloc: javascript: 57,049; sh: 43; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 1,294 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/// <reference path="../../observable.ts" />
module Rx {
    export interface Observable<T> {
        /**
        * Converts the observable sequence to a Map if it exists.
        * @param {Function} keySelector A function which produces the key for the Map.
        * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
        * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
        */
        toMap<TKey>(keySelector: (value: T) => TKey): Observable<Map<TKey, T>>;
        /**
        * Converts the observable sequence to a Map if it exists.
        * @param {Function} keySelector A function which produces the key for the Map.
        * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
        * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
        */
        toMap<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement): Observable<Map<TKey, TElement>>;
    }
}