-
Notifications
You must be signed in to change notification settings - Fork 3k
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
docs: include additional interfaces to docs #6391
docs: include additional interfaces to docs #6391
Conversation
@@ -61,9 +61,10 @@ export const defaultThrottleConfig: ThrottleConfig = { | |||
*/ | |||
export function throttle<T>( | |||
durationSelector: (value: T) => ObservableInput<any>, | |||
{ leading, trailing }: ThrottleConfig = defaultThrottleConfig | |||
config: ThrottleConfig = defaultThrottleConfig |
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.
This change is added just because we could have a better documentation. Instead of this:
we can have this:
src/index.ts
Outdated
@@ -95,6 +95,12 @@ export { NEVER } from './internal/observable/never'; | |||
|
|||
/* Types */ | |||
export * from './internal/types'; | |||
export { ConnectConfig } from './internal/operators/connect'; |
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.
While I think it makes sense that you put these here, it's probably better just to have them next to the operators they're with. Just to help show the relationship a little more clearly.
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.
@benlesh, since #6488 has been merged to master, I think it would be wise to move exported interfaces back to this file and keep them exported only here.
The first reason is to avoid duplication - we don't want to export stuff in two interfaces (also, dgeni tools don't like duplicated stuff; also duplication is hard to maintain - what if a new interface is added, would a creator of that interface know that it should be added to both files?).
The second reason, if they would remain in /src/operators/index.ts
file: that file will most probably be removed, so we want to have all exported interfaces in one place before removal so we don't remove exported interfaces accidentally.
Please let me know your thoughts on this. Thanks.
): MonoTypeOperatorFunction<T> { | ||
return operate((source, subscriber) => { | ||
const { leading, trailing } = config; |
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.
interesting. Was this change necessary for documentation reasons? That's sort of bananas.
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.
Yes, please take a look at this comment.
ddbac9e
to
a1b9891
Compare
Included new const options: GroupByOptionsWithElement<string, string, string> = {
element: value => value.trim()
};
const grouped = groupBy(val => val, options);
const groupedLowerCase = groupBy(val => val.toLowerCase(), options); |
2eb75c4
to
a1b9891
Compare
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.
LGTM but I would like someone else from the team to have a look to make sure I am not missing something
Thanks @niklas-wortmann. I'm still waiting for @benlesh to confirm this. |
Description:
These types are exported so they can be included to the docs. I was thinking about where to include them, to
src/index.ts
orsrc/operators/index.ts
, but I chosesrc/index.ts
. The reason is that on the API list page, we want to add exported interface to the index section, rather than to the operators section, like this:Another note: I added
TimeoutInfo
to exports becauseTimeoutConfig
is now being exported and it's got with property that usesTimeoutInfo
as a callback property.Related issue (if exists):
Somewhat #6247 and a related comment.