Skip to content

Commit

Permalink
docs: add UnaryFunction documentation (#6885)
Browse files Browse the repository at this point in the history
* docs: add UnaryFunction documentation

* docs(UnaryFunction): use singular form

(cherry picked from commit 5234b8a)
  • Loading branch information
jakovljevic-mladen committed Mar 3, 2023
1 parent 871a254 commit 98a9b47
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/internal/types.ts
Expand Up @@ -14,8 +14,15 @@ declare global {
}
}

/** OPERATOR INTERFACES */
/* OPERATOR INTERFACES */

/**
* A function type interface that describes a function that accepts one parameter `T`
* and returns another parameter `R`.
*
* Usually used to describe {@link OperatorFunction} - it always takes a single
* parameter (the source Observable) and returns another Observable.
*/
export interface UnaryFunction<T, R> {
(source: T): R;
}
Expand Down Expand Up @@ -60,7 +67,7 @@ export interface TimeInterval<T> {
interval: number;
}

/** SUBSCRIPTION INTERFACES */
/* SUBSCRIPTION INTERFACES */

export interface Unsubscribable {
unsubscribe(): void;
Expand Down Expand Up @@ -108,7 +115,7 @@ export interface InteropObservable<T> {
[Symbol.observable]: () => Subscribable<T>;
}

/** NOTIFICATIONS */
/* NOTIFICATIONS */

/**
* A notification representing a "next" from an observable.
Expand Down Expand Up @@ -144,7 +151,7 @@ export interface CompleteNotification {
*/
export type ObservableNotification<T> = NextNotification<T> | ErrorNotification | CompleteNotification;

/** OBSERVER INTERFACES */
/* OBSERVER INTERFACES */

export interface NextObserver<T> {
closed?: boolean;
Expand Down Expand Up @@ -177,7 +184,7 @@ export interface Observer<T> {

export interface SubjectLike<T> extends Observer<T>, Subscribable<T> {}

/** SCHEDULER INTERFACES */
/* SCHEDULER INTERFACES */

export interface SchedulerLike extends TimestampProvider {
schedule<T>(work: (this: SchedulerAction<T>, state: T) => void, delay: number, state: T): Subscription;
Expand Down

0 comments on commit 98a9b47

Please sign in to comment.