source: trip-planner-front/node_modules/rxjs/src/internal/util/subscribeToArray.ts@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 389 bytes
Line 
1import { Subscriber } from '../Subscriber';
2
3/**
4 * Subscribes to an ArrayLike with a subscriber
5 * @param array The array or array-like to subscribe to
6 */
7export const subscribeToArray = <T>(array: ArrayLike<T>) => (subscriber: Subscriber<T>) => {
8 for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {
9 subscriber.next(array[i]);
10 }
11 subscriber.complete();
12};
Note: See TracBrowser for help on using the repository browser.