Skip to content

Commit 830e87a

Browse files
[removed] IndefiniteSubject
Summary: Closes #14 As discussed in that issue, IndefiniteSubject is moving to material-motion-js until it has been implemented on the other platforms and documented accordingly. Reviewers: O3 Material JavaScript platform reviewers, #material_motion, O2 Material Motion, featherless Reviewed By: #material_motion, O2 Material Motion, featherless Tags: #material_motion Differential Revision: http://codereview.cc/D2496
1 parent 129559b commit 830e87a

9 files changed

Lines changed: 0 additions & 383 deletions

build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ const licenseText = `/** @license
3737
"use strict";`;
3838

3939
const observableSource = readFileSync('./dist/IndefiniteObservable.js').toString();
40-
const subjectSource = readFileSync('./dist/IndefiniteSubject.js').toString();
4140
const wrapWithObserverSource = readFileSync('./dist/wrapWithObserver.js').toString();
4241
const symbolObservable = readFileSync('./third_party/symbol-observable/index.js').toString();
4342

4443
writeFileSync(
4544
'./dist/indefinite-observable.js',
4645
licenseText + '\n' +[
4746
observableSource.replace(licenseText, ''),
48-
subjectSource.replace(licenseText, ''),
4947
wrapWithObserverSource.replace(licenseText, ''),
5048
].join('\n\n').replace(
5149
/const symbol_observable_\d = require\("symbol-observable"\);/,

dist/IndefiniteSubject.d.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

dist/IndefiniteSubject.js

Lines changed: 0 additions & 78 deletions
This file was deleted.

dist/indefinite-observable.js

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -127,59 +127,6 @@ class IndefiniteObservable {
127127
}
128128
}
129129

130-
/**
131-
* An IndefiniteSubject is both an Observer and an Observable. Whenever it
132-
* receives a value on `next`, it forwards that value to any subscribed
133-
* observers.
134-
*
135-
* IndefiniteSubject is a multicast Observable; it remembers the most recent
136-
* value dispatched and passes it to any new subscriber.
137-
*/
138-
class IndefiniteSubject {
139-
constructor() {
140-
this._observers = new Set();
141-
this._hasStarted = false;
142-
}
143-
/**
144-
* Passes the supplied value to any currently-subscribed observers. If an
145-
* observer `subscribe`s before `next` is called again, it will immediately
146-
* receive `value`.
147-
*/
148-
next(value) {
149-
this._hasStarted = true;
150-
this._lastValue = value;
151-
this._observers.forEach((observer) => observer.next(value));
152-
}
153-
/**
154-
* `subscribe` accepts either a function or an object with a next method.
155-
* `subject.next` will forward any value it receives to the function or method
156-
* provided here.
157-
*
158-
* Call the returned `unsubscribe` method to stop receiving values on this
159-
* particular observer.
160-
*/
161-
subscribe(observerOrNext) {
162-
const observer = _wrapWithObserver(observerOrNext);
163-
this._observers.add(observer);
164-
if (this._hasStarted) {
165-
observer.next(this._lastValue);
166-
}
167-
return {
168-
unsubscribe: () => {
169-
this._observers.delete(observer);
170-
}
171-
};
172-
}
173-
/**
174-
* Tells other libraries that know about observables that we are one.
175-
*
176-
* https://github.com/tc39/proposal-observable#observable
177-
*/
178-
[$observable]() {
179-
return this;
180-
}
181-
}
182-
183130
function _wrapWithObserver(listener) {
184131
if (typeof listener === 'function') {
185132
return {

dist/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@
1616
export * from './types';
1717
export * from './IndefiniteObservable';
1818
export { default as IndefiniteObservable } from './IndefiniteObservable';
19-
export * from './IndefiniteSubject';
20-
export { default as IndefiniteSubject } from './IndefiniteSubject';

dist/index.js

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

src/IndefiniteSubject.ts

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)