Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1160,18 +1160,18 @@ The returned promise will fulfill after all the events have been consumed, or wi

#### `stream.subscribe(Observer) -> Subscription`

Draft ES Observable compatible subscribe. Start consuming events from `stream` by providing an [Observer object](https://github.com/zenparsing/es-observable#observer).
Draft ES Observable compatible subscribe. Start consuming events from `stream` by providing an [Observer object](https://github.com/zenparsing/es-observable#observer). All methods on `Observer` are optional.

<!-- skip-example -->
```js
type Observer = {
// Receives the next value in the sequence
next(value) => void
next?(value) => void
// Receives the sequence error
error(errorValue) => void
error?(errorValue) => void
// Receives the sequence completion signal
// The completionValue parameter is deprecated
complete(completionValue) => void
complete?(completionValue) => void
}
```

Expand Down
6 changes: 3 additions & 3 deletions type-definitions/most.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export interface Observable<A> {
}

export interface Subscriber<A> {
next(value: A): void;
error(err: Error): void;
next?(value: A): void;
error?(err: Error): void;
// complete value parameter is deprecated
complete(value?: A): void;
complete?(value?: A): void;
}

export interface Subscription<A> {
Expand Down