a zip code crypto-currency system good for red ONLY

map.d.ts 1.6KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { Observable } from '../Observable';
  2. /**
  3. * Applies a given `project` function to each value emitted by the source
  4. * Observable, and emits the resulting values as an Observable.
  5. *
  6. * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
  7. * it passes each source value through a transformation function to get
  8. * corresponding output values.</span>
  9. *
  10. * <img src="./img/map.png" width="100%">
  11. *
  12. * Similar to the well known `Array.prototype.map` function, this operator
  13. * applies a projection to each value and emits that projection in the output
  14. * Observable.
  15. *
  16. * @example <caption>Map every click to the clientX position of that click</caption>
  17. * var clicks = Rx.Observable.fromEvent(document, 'click');
  18. * var positions = clicks.map(ev => ev.clientX);
  19. * positions.subscribe(x => console.log(x));
  20. *
  21. * @see {@link mapTo}
  22. * @see {@link pluck}
  23. *
  24. * @param {function(value: T, index: number): R} project The function to apply
  25. * to each `value` emitted by the source Observable. The `index` parameter is
  26. * the number `i` for the i-th emission that has happened since the
  27. * subscription, starting from the number `0`.
  28. * @param {any} [thisArg] An optional argument to define what `this` is in the
  29. * `project` function.
  30. * @return {Observable<R>} An Observable that emits the values from the source
  31. * Observable transformed by the given `project` function.
  32. * @method map
  33. * @owner Observable
  34. */
  35. export declare function map<T, R>(this: Observable<T>, project: (value: T, index: number) => R, thisArg?: any): Observable<R>;