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

Last change on this file since e29cc2e 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.