Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Observer

An object interface that defines a set of callback functions a user can use to get notified of any set of Observable {@link guide/glossary-and-semantics#notification | notification} events.

For more info, please refer to {@link guide/observer | this guide}.

interface Observer <T> {
complete: () => void;
error: (err: any) => void;
next: (value: T) => void;
}

§Type Parameters

§Properties

§
complete: () => void
[src]

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}.

§
error: (err: any) => void
[src]

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}.