Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
437 bytes
|
Line | |
---|
1 | import { observable as Symbol_observable } from '../symbol/observable';
|
---|
2 | export const subscribeToObservable = (obj) => (subscriber) => {
|
---|
3 | const obs = obj[Symbol_observable]();
|
---|
4 | if (typeof obs.subscribe !== 'function') {
|
---|
5 | throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
---|
6 | }
|
---|
7 | else {
|
---|
8 | return obs.subscribe(subscriber);
|
---|
9 | }
|
---|
10 | };
|
---|
11 | //# sourceMappingURL=subscribeToObservable.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.