Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
389 bytes
|
Line | |
---|
1 | import { 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 | */
|
---|
7 | export 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.