Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 90786fc

Browse files
Adding parent/child to Observable.create
1 parent 7aa3b80 commit 90786fc

20 files changed

+54
-61
lines changed

dist/rx.all.compat.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -2356,17 +2356,15 @@ if (!Array.prototype.forEach) {
23562356

23572357
/**
23582358
* Creates an observable sequence from a specified subscribe method implementation.
2359-
*
23602359
* @example
23612360
* var res = Rx.Observable.create(function (observer) { return function () { } );
23622361
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
23632362
* var res = Rx.Observable.create(function (observer) { } );
2364-
*
23652363
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
23662364
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
23672365
*/
2368-
Observable.create = Observable.createWithDisposable = function (subscribe) {
2369-
return new AnonymousObservable(subscribe);
2366+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
2367+
return new AnonymousObservable(subscribe, parent);
23702368
};
23712369

23722370
/**
@@ -9323,7 +9321,8 @@ if (!Array.prototype.forEach) {
93239321
disposableEmpty;
93249322
}
93259323

9326-
function AnonymousObservable(subscribe) {
9324+
function AnonymousObservable(subscribe, parent) {
9325+
this.source = parent;
93279326
if (!(this instanceof AnonymousObservable)) {
93289327
return new AnonymousObservable(subscribe);
93299328
}

dist/rx.all.compat.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.all.compat.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -2205,17 +2205,15 @@
22052205

22062206
/**
22072207
* Creates an observable sequence from a specified subscribe method implementation.
2208-
*
22092208
* @example
22102209
* var res = Rx.Observable.create(function (observer) { return function () { } );
22112210
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
22122211
* var res = Rx.Observable.create(function (observer) { } );
2213-
*
22142212
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
22152213
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
22162214
*/
2217-
Observable.create = Observable.createWithDisposable = function (subscribe) {
2218-
return new AnonymousObservable(subscribe);
2215+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
2216+
return new AnonymousObservable(subscribe, parent);
22192217
};
22202218

22212219
/**
@@ -9104,7 +9102,8 @@
91049102
disposableEmpty;
91059103
}
91069104

9107-
function AnonymousObservable(subscribe) {
9105+
function AnonymousObservable(subscribe, parent) {
9106+
this.source = parent;
91089107
if (!(this instanceof AnonymousObservable)) {
91099108
return new AnonymousObservable(subscribe);
91109109
}

dist/rx.all.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.all.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.compat.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -2356,17 +2356,15 @@ if (!Array.prototype.forEach) {
23562356

23572357
/**
23582358
* Creates an observable sequence from a specified subscribe method implementation.
2359-
*
23602359
* @example
23612360
* var res = Rx.Observable.create(function (observer) { return function () { } );
23622361
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
23632362
* var res = Rx.Observable.create(function (observer) { } );
2364-
*
23652363
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
23662364
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
23672365
*/
2368-
Observable.create = Observable.createWithDisposable = function (subscribe) {
2369-
return new AnonymousObservable(subscribe);
2366+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
2367+
return new AnonymousObservable(subscribe, parent);
23702368
};
23712369

23722370
/**
@@ -4359,7 +4357,8 @@ if (!Array.prototype.forEach) {
43594357
disposableEmpty;
43604358
}
43614359

4362-
function AnonymousObservable(subscribe) {
4360+
function AnonymousObservable(subscribe, parent) {
4361+
this.source = parent;
43634362
if (!(this instanceof AnonymousObservable)) {
43644363
return new AnonymousObservable(subscribe);
43654364
}

dist/rx.compat.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.compat.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -2205,17 +2205,15 @@
22052205

22062206
/**
22072207
* Creates an observable sequence from a specified subscribe method implementation.
2208-
*
22092208
* @example
22102209
* var res = Rx.Observable.create(function (observer) { return function () { } );
22112210
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
22122211
* var res = Rx.Observable.create(function (observer) { } );
2213-
*
22142212
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
22152213
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
22162214
*/
2217-
Observable.create = Observable.createWithDisposable = function (subscribe) {
2218-
return new AnonymousObservable(subscribe);
2215+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
2216+
return new AnonymousObservable(subscribe, parent);
22192217
};
22202218

22212219
/**
@@ -4208,7 +4206,8 @@
42084206
disposableEmpty;
42094207
}
42104208

4211-
function AnonymousObservable(subscribe) {
4209+
function AnonymousObservable(subscribe, parent) {
4210+
this.source = parent;
42124211
if (!(this instanceof AnonymousObservable)) {
42134212
return new AnonymousObservable(subscribe);
42144213
}

dist/rx.lite.compat.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -2068,17 +2068,15 @@ if (!Array.prototype.forEach) {
20682068

20692069
/**
20702070
* Creates an observable sequence from a specified subscribe method implementation.
2071-
*
20722071
* @example
20732072
* var res = Rx.Observable.create(function (observer) { return function () { } );
20742073
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
20752074
* var res = Rx.Observable.create(function (observer) { } );
2076-
*
20772075
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
20782076
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
20792077
*/
2080-
Observable.create = Observable.createWithDisposable = function (subscribe) {
2081-
return new AnonymousObservable(subscribe);
2078+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
2079+
return new AnonymousObservable(subscribe, parent);
20822080
};
20832081

20842082
/**
@@ -4885,7 +4883,8 @@ if (!Array.prototype.forEach) {
48854883
disposableEmpty;
48864884
}
48874885

4888-
function AnonymousObservable(subscribe) {
4886+
function AnonymousObservable(subscribe, parent) {
4887+
this.source = parent;
48894888
if (!(this instanceof AnonymousObservable)) {
48904889
return new AnonymousObservable(subscribe);
48914890
}

dist/rx.lite.compat.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.lite.compat.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.lite.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
9191
) {
9292
var stacks = [];
93-
for (var o = observer; !!o; o = o.source) {
93+
for (var o = observable; !!o; o = o.source) {
9494
if (o.stack) {
9595
stacks.unshift(o.stack);
9696
}
@@ -1917,17 +1917,15 @@
19171917

19181918
/**
19191919
* Creates an observable sequence from a specified subscribe method implementation.
1920-
*
19211920
* @example
19221921
* var res = Rx.Observable.create(function (observer) { return function () { } );
19231922
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
19241923
* var res = Rx.Observable.create(function (observer) { } );
1925-
*
19261924
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
19271925
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
19281926
*/
1929-
Observable.create = Observable.createWithDisposable = function (subscribe) {
1930-
return new AnonymousObservable(subscribe);
1927+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
1928+
return new AnonymousObservable(subscribe, parent);
19311929
};
19321930

19331931
/**
@@ -4666,7 +4664,8 @@
46664664
disposableEmpty;
46674665
}
46684666

4669-
function AnonymousObservable(subscribe) {
4667+
function AnonymousObservable(subscribe, parent) {
4668+
this.source = parent;
46704669
if (!(this instanceof AnonymousObservable)) {
46714670
return new AnonymousObservable(subscribe);
46724671
}

dist/rx.lite.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.lite.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/rx.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/anonymousobservable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
disposableEmpty;
1111
}
1212

13-
function AnonymousObservable(subscribe) {
13+
function AnonymousObservable(subscribe, parent) {
14+
this.source = parent;
1415
if (!(this instanceof AnonymousObservable)) {
1516
return new AnonymousObservable(subscribe);
1617
}

src/core/linq/observable/create.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/**
22
* Creates an observable sequence from a specified subscribe method implementation.
3-
*
43
* @example
54
* var res = Rx.Observable.create(function (observer) { return function () { } );
65
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
76
* var res = Rx.Observable.create(function (observer) { } );
8-
*
97
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
108
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
119
*/
12-
Observable.create = Observable.createWithDisposable = function (subscribe) {
13-
return new AnonymousObservable(subscribe);
10+
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
11+
return new AnonymousObservable(subscribe, parent);
1412
};

0 commit comments

Comments
 (0)