-
Notifications
You must be signed in to change notification settings - Fork 3k
Improve from #1528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve from #1528
Changes from all commits
1f37d7d
e020228
aa17119
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
interface Symbol { } | ||
interface SymbolConstructor { | ||
iterator: symbol; | ||
} | ||
declare var Symbol: SymbolConstructor; | ||
interface Iterable<T> { | ||
[Symbol.iterator](): Iterator<T>; | ||
} | ||
interface Iterator<T> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's difference this to what we're currently using in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what I meant was |
||
next(value?: any): IteratorResult<T>; | ||
return?(value?: any): IteratorResult<T>; | ||
throw?(e?: any): IteratorResult<T>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,13 @@ export interface Subscribable<T> { | |
subscribe(observer: Observer<T>): AnonymousSubscription; | ||
} | ||
|
||
export type SubscribableOrPromise<T> = Subscribable<T> | Promise<T>; | ||
export type ArrayOrIterator<T> = Iterator<T> | ArrayLike<T>; | ||
export type ObservableInput<T> = SubscribableOrPromise<T> | ArrayOrIterator<T>; | ||
export interface Observablesque<T> { | ||
[Symbol.observable](): Subscribable<T>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small thing here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You know what? Scratch that. Don't worry about it, for the purposes of the internals of our library where this is being used, we don't care. |
||
} | ||
|
||
export type SubscribableOrPromise<T> = Observablesque<T> | Subscribable<T> | Promise<T>; | ||
export type ArrayOrIterable<T> = Iterable<T> | ArrayLike<T>; | ||
export type ObservableInput<T> = SubscribableOrPromise<T> | ArrayOrIterable<T>; | ||
|
||
/** | ||
* A representation of any set of values over any amount of time. This the most basic building block | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare interface SymbolConstructor { | ||
observable: symbol; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this type definition's placed under test cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically because specs will fail to compile without it, and there is no way to indicate in
tsconfig.json
to add one additional file, without declaring all the files. The easiest place was to add it in the specs folder, and then reference it from the builds.