From f044a53b4df0e734d312c5d39c11a5146e632a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Jakovljevi=C4=87?= Date: Tue, 26 Apr 2022 22:40:25 +0200 Subject: [PATCH 1/2] docs(Observer): add documentation to Observer interface --- src/internal/types.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/internal/types.ts b/src/internal/types.ts index 2b9d237606..c56e6ea0e7 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -169,9 +169,42 @@ export interface CompletionObserver { export type PartialObserver = NextObserver | ErrorObserver | CompletionObserver; +/** + * An object interface that defines a set of callback functions a user can use to get + * notified of any set of {@link Observable} + * {@link guide/glossary-and-semantics#notification notification} events. + * + * For more info, please refer to {@link guide/observer this guide}. + */ export interface Observer { + /** + * A callback function that gets called by the producer during the subscription when + * the producer "has" the `value`. It won't be called if `error` or `complete` callback + * functions have been called, nor after the consumer has unsubscribed. + * + * For more info, please refer to {@link guide/glossary-and-semantics#next this guide}. + */ next: (value: T) => void; + /** + * A callback function that gets called by the producer if and when it encountered a + * problem of any kind. The errored value will be provided through the `err` parameter. + * This callback can't be called more than one time, it can't be called if the + * `complete` callback function have been called previously, nor it can't be called if + * the consumer has unsubscribed. + * + * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}. + * @param err + */ error: (err: any) => void; + /** + * A callback function that gets called by the producer if and when it has no more + * values to provide (by calling `next` callback function). This means that no error + * has happened. This callback can't be called more than one time, it can't be called + * if the `error` callback function have been called previously, nor it can't be called + * if the consumer has unsubscribed. + * + * For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}. + */ complete: () => void; } From 031c4850b880840a9de43caa9007dc010d089010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Jakovljevi=C4=87?= Date: Tue, 26 Apr 2022 22:56:49 +0200 Subject: [PATCH 2/2] docs(Observer): remove unused docs annotation --- src/internal/types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/internal/types.ts b/src/internal/types.ts index c56e6ea0e7..ff44ffcb24 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -193,7 +193,6 @@ export interface Observer { * the consumer has unsubscribed. * * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}. - * @param err */ error: (err: any) => void; /**