Skip to content

Commit

Permalink
feat(EMPTY): observable constant EMPTY now exported
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Jan 24, 2018
1 parent 5c7c749 commit 08fb074
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/index-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ describe('index', () => {
expect(index.noop).to.exist;
expect(index.identity).to.exist;
});

it('should export constants', () => {
expect(index.EMPTY).to.exist;
});
});
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ export { pipe } from './internal/util/pipe';
export { noop } from './internal/util/noop';
export { identity } from './internal/util/identity';

/* Constants */
export { EMPTY } from './internal/observable/empty';

/* Types */
export * from './internal/types';
4 changes: 4 additions & 0 deletions src/internal/observable/empty.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Observable } from '../Observable';
import { IScheduler } from '../Scheduler';

/**
* The same Observable instance returned by any call to {@link empty} without a
* {@link Scheduler}. It is preferrable to use this over `empty()`.
*/
export const EMPTY = new Observable<never>(subscriber => subscriber.complete());

/**
Expand Down

0 comments on commit 08fb074

Please sign in to comment.