Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pluck.d.ts 1.1KB

12345678910111213141516171819202122232425262728293031
  1. import { OperatorFunction } from '../types';
  2. /**
  3. * Maps each source value (an object) to its specified nested property.
  4. *
  5. * <span class="informal">Like {@link map}, but meant only for picking one of
  6. * the nested properties of every emitted object.</span>
  7. *
  8. * ![](pluck.png)
  9. *
  10. * Given a list of strings describing a path to an object property, retrieves
  11. * the value of a specified nested property from all values in the source
  12. * Observable. If a property can't be resolved, it will return `undefined` for
  13. * that value.
  14. *
  15. * ## Example
  16. * Map every click to the tagName of the clicked target element
  17. * ```javascript
  18. * const clicks = fromEvent(document, 'click');
  19. * const tagNames = clicks.pipe(pluck('target', 'tagName'));
  20. * tagNames.subscribe(x => console.log(x));
  21. * ```
  22. *
  23. * @see {@link map}
  24. *
  25. * @param {...string} properties The nested properties to pluck from each source
  26. * value (an object).
  27. * @return {Observable} A new Observable of property values from the source values.
  28. * @method pluck
  29. * @owner Observable
  30. */
  31. export declare function pluck<T, R>(...properties: string[]): OperatorFunction<T, R>;