Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1adab71
Added isObserverNotification to @observable/materialize and updated d…
alexanderharding Apr 15, 2026
fdc7700
Updated @observable/all documentation to align with standard terminology
alexanderharding Apr 15, 2026
41192a9
Updated @observable/async-await documentation to align with standard …
alexanderharding Apr 15, 2026
5293979
Updated @observable/at documentation to align with standard terminology
alexanderharding Apr 15, 2026
3ecfbfd
Updated @observable/for-in documentation to align with standard termi…
alexanderharding Apr 15, 2026
7b09417
Updated @observable/for-await-of documentation to align with standard…
alexanderharding Apr 15, 2026
f56abdc
Updated @observable/for-of documentation to align with standard termi…
alexanderharding Apr 15, 2026
1fce450
Updated @observable/interval documentation to align with standard ter…
alexanderharding Apr 15, 2026
e73dc41
Updated @observable/last-value-from documentation to align with stand…
alexanderharding Apr 15, 2026
fcf0f76
Updated @observable/merge documentation to align with standard termin…
alexanderharding Apr 15, 2026
19b9bdb
Updated @observable/of documentation to align with standard terminology
alexanderharding Apr 15, 2026
c575ae9
Updated @observable/pairwise documentation to align with standard ter…
alexanderharding Apr 15, 2026
6c57b67
Updated @observable/take documentation to align with standard termino…
alexanderharding Apr 15, 2026
0e2983c
Updated @observable/take-until documentation to align with standard t…
alexanderharding Apr 15, 2026
5b52793
Updated @observable/repeat documentation to align with standard termi…
alexanderharding Apr 15, 2026
60dfad7
Updated @observable/timeout documentation to align with standard term…
alexanderharding Apr 15, 2026
2855db9
Updated @observable/race documentation to align with standard termino…
alexanderharding Apr 15, 2026
aa27e86
Updated @observable/reduce documentation to align with standard termi…
alexanderharding Apr 15, 2026
c4630b9
Updated @observable/scan documentation to align with standard termino…
alexanderharding Apr 15, 2026
2e301f5
Updated @observable/flat documentation to align with standard termino…
alexanderharding Apr 15, 2026
029e395
Updated @observable/flat-map documentation to align with standard ter…
alexanderharding Apr 15, 2026
e5b76ed
Updated @observable/merge-map documentation to align with standard te…
alexanderharding Apr 15, 2026
cd1885f
Updated @observable/exhaust-map documentation to align with standard …
alexanderharding Apr 15, 2026
e642a56
Updated @observable/expand documentation to align with standard termi…
alexanderharding Apr 15, 2026
38a19e4
Updated @observable/debounce documentation to align with standard ter…
alexanderharding Apr 15, 2026
4e18582
Updated @observable/delay documentation to align with standard termin…
alexanderharding Apr 15, 2026
57f8790
Updated @observable/timeout documentation to align with standard term…
alexanderharding Apr 15, 2026
9141640
Updated @observable/throttle documentation to align with standard ter…
alexanderharding Apr 15, 2026
d24feb7
Updated @observable/distinct-until-changed documentation to align wit…
alexanderharding Apr 15, 2026
0029fb8
Updated @observable/distinct documentation to align with standard ter…
alexanderharding Apr 15, 2026
4bf12c0
Updated @observable/filter documentation to align with standard termi…
alexanderharding Apr 15, 2026
56d9293
Updated @observable/take documentation to align with standard termino…
alexanderharding Apr 15, 2026
e82a5c1
Updated @observable/take-until documentation to align with standard t…
alexanderharding Apr 15, 2026
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
55 changes: 53 additions & 2 deletions all/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# [@observable/all](https://jsr.io/@observable/all)

[`Next`](https://jsr.io/@observable/core/doc/~/Observer.next)s an
[Pushes](https://jsr.io/@observable/core#push) an
[`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of
values from _all_ of the given `observables` in
the latest values from _all_ of the given `observables` in
[iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol)
order.

Expand Down Expand Up @@ -88,6 +88,57 @@ all([]).subscribe({
// "return"
```

Iterable of observables

```ts
import { all } from "@observable/all";
import { Subject } from "@observable/core";

const subject1 = new Subject<number>();
const subject2 = subject1;
const subject3 = new Subject<number>();
const controller = new AbortController();

all(new Set([subject1, subject2, subject3])).subscribe({
signal: controller.signal,
next: (value) => console.log("next", value),
return: () => console.log("return"),
throw: (value) => console.log("throw", value),
});

subject2.next(1);
subject1.next(2);
subject3.next(3); // "next" [2, 3]
subject1.next(4); // "next" [4, 3]
subject2.next(5); // "next" [4, 5]
subject1.return();
subject3.return(); // "return"
subject2.return();
```

Iterable with an empty observable

```ts
import { all } from "@observable/all";
import { forOf } from "@observable/for-of";
import { pipe } from "@observable/pipe";
import { empty } from "@observable/empty";

const observable1 = forOf([1, 2, 3]);
const observable2 = forOf([7, 8, 9]);
const controller = new AbortController();

all(new Set([observable1, empty, observable2])).subscribe({
signal: controller.signal,
next: (value) => console.log("next", value),
return: () => console.log("return"),
throw: (value) => console.log("throw", value),
});

// Console output:
// "return"
```

# AI Prompt

Use the following prompt with AI assistants to help them understand this library:
Expand Down
2 changes: 1 addition & 1 deletion all/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/all",
"version": "0.15.0",
"version": "0.16.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
9 changes: 5 additions & 4 deletions all/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { takeUntil } from "@observable/take-until";
import { finalize } from "@observable/finalize";

/**
* [`Next`](https://jsr.io/@observable/core/doc/~/Observer.next)s {@linkcode Values|values} from _all_ of the given
* [Pushes](https://jsr.io/@observable/core#push) the latest {@linkcode Values|values} from _all_ of the given
* {@linkcode observables} in [index](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_indices)
* order.
* @example
Expand Down Expand Up @@ -83,9 +83,9 @@ export function all<const Values extends ReadonlyArray<unknown>>(
observables: Readonly<{ [Key in keyof Values]: Observable<Values[Key]> }>,
): Observable<Values>;
/**
* [`Next`](https://jsr.io/@observable/core/doc/~/Observer.next)s an [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
* of {@linkcode Value|values} from _all_ of the given {@linkcode observables} in [iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol)
* order.
* [Pushes](https://jsr.io/@observable/core#push) an [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
* of the latest {@linkcode Value|values} from _all_ of the given {@linkcode observables} in
* [iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) order.
* @example
* Iterable of observables
* ```ts
Expand All @@ -103,6 +103,7 @@ export function all<const Values extends ReadonlyArray<unknown>>(
* return: () => console.log("return"),
* throw: (value) => console.log("throw", value),
* });
*
* subject2.next(1);
* subject1.next(2);
* subject3.next(3); // "next" [2, 3]
Expand Down
3 changes: 1 addition & 2 deletions async-await/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# [@observable/async-await](https://jsr.io/@observable/async-await)

[`Await`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)s the
given `expression`, [`next`](https://jsr.io/@observable/core/doc/~/Observer.next)s its resolved
value, and then [`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s.
given `expression` and [pushes](https://jsr.io/@observable/core#push) its resolved value.

## Build

Expand Down
2 changes: 1 addition & 1 deletion async-await/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/async-await",
"version": "0.4.0",
"version": "0.5.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
3 changes: 1 addition & 2 deletions async-await/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { Observable } from "@observable/core";

/**
* [`Await`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)s the given
* {@linkcode expression}, [`next`](https://jsr.io/@observable/core/doc/~/Observer.next)s its resolved value, and then
* [`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s.
* {@linkcode expression} and [pushes](https://jsr.io/@observable/core#push) its resolved value.
* @example
* Resolved promise
* ```ts
Expand Down
5 changes: 2 additions & 3 deletions at/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# [@observable/at](https://jsr.io/@observable/at)

[`Next`](https://jsr.io/@observable/core/doc/~/Observer.next)s the first value at the given `index`
and then [`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s. Negative indices count
back from the last value in the sequence.
[Pushes](https://jsr.io/@observable/core#push) the first value at the given `index`. Negative
indices count back from the last value in the sequence.

## Build

Expand Down
2 changes: 1 addition & 1 deletion at/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/at",
"version": "0.6.0",
"version": "0.7.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
5 changes: 2 additions & 3 deletions at/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { empty } from "@observable/empty";
import { from } from "@observable/from";

/**
* [`Next`](https://jsr.io/@observable/core/doc/~/Observer.next)s the first {@linkcode Value|value} at the given
* {@linkcode index} and then [`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s. Negative
* {@linkcode index|indices} count back from the last {@linkcode Value|value} in the sequence.
* [Pushes](https://jsr.io/@observable/core#push) the first {@linkcode Value|value} at the given
* {@linkcode index}. Negative {@linkcode index|indices} count back from the last {@linkcode Value|value} in the sequence.
* @example
* Positive index integer
* ```ts
Expand Down
2 changes: 1 addition & 1 deletion debounce/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [@observable/debounce](https://jsr.io/@observable/debounce)

Debounces each value by the given number of `milliseconds`.
Debounces each value by the given `milliseconds`.

## Build

Expand Down
2 changes: 1 addition & 1 deletion debounce/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/debounce",
"version": "0.17.0",
"version": "0.18.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
2 changes: 1 addition & 1 deletion delay/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [@observable/delay](https://jsr.io/@observable/delay)

Delays values by the given number of `milliseconds`.
Delays values by the given `milliseconds`.

## Build

Expand Down
2 changes: 1 addition & 1 deletion delay/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/delay",
"version": "0.1.0",
"version": "0.2.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
2 changes: 1 addition & 1 deletion delay/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { drop } from "@observable/drop";
import { from } from "@observable/from";

/**
* Delays {@linkcode Value|values} by the given number of {@linkcode milliseconds}.
* Delays {@linkcode Value|values} by the given {@linkcode milliseconds}.
* @example
* 1000 milliseconds
* ```ts
Expand Down
4 changes: 2 additions & 2 deletions distinct-until-changed/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [@observable/distinct-until-changed](https://jsr.io/@observable/distinct-until-changed)

Filters each value that is distinct from the previous value according to the given `comparator`
function or
[Pushes](https://jsr.io/@observable/core#push) each value that is distinct from the previous value
according to the given `comparator` function or
[`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
if one is not provided.

Expand Down
2 changes: 1 addition & 1 deletion distinct-until-changed/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/distinct-until-changed",
"version": "0.16.0",
"version": "0.17.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
12 changes: 8 additions & 4 deletions distinct-until-changed/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { of } from "@observable/of";
const noValue = Symbol("Flag indicating that no value has been emitted yet");

/**
* Filters each {@linkcode Value|value} that is [distinct](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
* [Pushes](https://jsr.io/@observable/core#push) each {@linkcode Value|value} that is
* [distinct](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
* from the previous {@linkcode Value|value}.
* @example
* ```ts
Expand All @@ -40,7 +41,8 @@ const noValue = Symbol("Flag indicating that no value has been emitted yet");
*/
export function distinctUntilChanged<Value>(): (source: Observable<Value>) => Observable<Value>;
/**
* Filters each {@linkcode Value|value} that is distinct from the previous {@linkcode Value|value} according to the given {@linkcode comparator} function.
* [Pushes](https://jsr.io/@observable/core#push) each {@linkcode Value|value} that is distinct from the previous
* {@linkcode Value|value} according to the given {@linkcode comparator} function.
* @example
* ```ts
* import { distinctUntilChanged } from "@observable/distinct-until-changed";
Expand All @@ -66,8 +68,10 @@ export function distinctUntilChanged<Value>(
comparator: (previous: Value, current: Value) => boolean,
): (source: Observable<Value>) => Observable<Value>;
/**
* Filters each {@linkcode Value|value} that is distinct from the previous {@linkcode Value|value} according to the given {@linkcode comparator}
* function or [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) if one is not provided.
* [Pushes](https://jsr.io/@observable/core#push) each {@linkcode Value|value} that is distinct from the previous
* {@linkcode Value|value} according to the given {@linkcode comparator} function or
* [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) if one is
* not provided.
* @example
* Default comparator
* ```ts
Expand Down
2 changes: 1 addition & 1 deletion distinct/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [@observable/distinct](https://jsr.io/@observable/distinct)

Filters values that are
[Pushes](https://jsr.io/@observable/core#push) values that are
[distinct](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
from all previous values.

Expand Down
2 changes: 1 addition & 1 deletion distinct/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/distinct",
"version": "0.13.0",
"version": "0.14.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
3 changes: 2 additions & 1 deletion distinct/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { tap } from "@observable/tap";
import { filter } from "@observable/filter";

/**
* Filters {@linkcode Value|values} that are [distinct](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
* [Pushes](https://jsr.io/@observable/core#push) {@linkcode Value|values} that are
* [distinct](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
* from all previous {@linkcode Value|values}.
* @example
* ```ts
Expand Down
8 changes: 4 additions & 4 deletions exhaust-map/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# [@observable/exhaust-map](https://jsr.io/@observable/exhaust-map)

Projects each value to an [`Observable`](https://jsr.io/@observable/core/doc/~/Observable) ignoring
any new values until the projected [`Observable`](https://jsr.io/@observable/core/doc/~/Observable)
[`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s.
any new value until all values of the projected
[`Observable`](https://jsr.io/@observable/core/doc/~/Observable) have been
[pushed](https://jsr.io/@observable/core#push).

## Build

Expand All @@ -27,10 +28,9 @@ import { timeout } from "@observable/timeout";
import { map } from "@observable/map";

const controller = new AbortController();
const observable = forOf([1, 2, 3]);

pipe(
observable,
forOf([1, 2, 3]),
exhaustMap((value) => pipe(timeout(100), map(() => value))),
).subscribe({
signal: controller.signal,
Expand Down
2 changes: 1 addition & 1 deletion exhaust-map/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/exhaust-map",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
7 changes: 3 additions & 4 deletions exhaust-map/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { finalize } from "@observable/finalize";

/**
* {@linkcode project|Projects} each {@linkcode In|value} to an [`Observable`](https://jsr.io/@observable/core/doc/~/Observable) ignoring any new
* {@linkcode In|values} until the {@linkcode project|projected} [`Observable`](https://jsr.io/@observable/core/doc/~/Observable)
* [`return`](https://jsr.io/@observable/core/doc/~/Observer.return)s.
* {@linkcode In|values} until all {@linkcode Out|values} of the {@linkcode project|projected} [`Observable`](https://jsr.io/@observable/core/doc/~/Observable)
* have been [pushed](https://jsr.io/@observable/core#push).
* @example
* ```ts
* import { exhaustMap } from "@observable/exhaust-map";
Expand All @@ -18,10 +18,9 @@ import { finalize } from "@observable/finalize";
* import { map } from "@observable/map";
*
* const controller = new AbortController();
* const observable = forOf([1, 2, 3]);
*
* pipe(
* observable,
* forOf([1, 2, 3]),
* exhaustMap((value) => pipe(timeout(100), map(() => value))),
* ).subscribe({
* signal: controller.signal,
Expand Down
4 changes: 2 additions & 2 deletions expand/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [@observable/expand](https://jsr.io/@observable/expand)

Recursively projects each value to an
[`Observable`](https://jsr.io/@observable/core/doc/~/Observable).
Projects each value to an [`Observable`](https://jsr.io/@observable/core/doc/~/Observable)
recursively.

## Build

Expand Down
2 changes: 1 addition & 1 deletion expand/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/expand",
"version": "0.10.0",
"version": "0.11.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
4 changes: 2 additions & 2 deletions expand/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { defer } from "@observable/defer";
import { of } from "@observable/of";

/**
* Recursively {@linkcode project|projects} each {@linkcode Value|value} to an
* [`Observable`](https://jsr.io/@observable/core/doc/~/Observable).
* {@linkcode project|Projects} each {@linkcode Value|value} to an
* [`Observable`](https://jsr.io/@observable/core/doc/~/Observable) recursively.
* @example
* Double until 16
* ```ts
Expand Down
2 changes: 1 addition & 1 deletion filter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [@observable/filter](https://jsr.io/@observable/filter)

Filters values that satisfy the given `predicate` function.
[Pushes](https://jsr.io/@observable/core#push) values that satisfy the given `predicate` function.

## Build

Expand Down
2 changes: 1 addition & 1 deletion filter/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observable/filter",
"version": "0.11.0",
"version": "0.12.0",
"license": "MIT",
"exports": "./mod.ts",
"publish": { "exclude": ["*.test.ts"] }
Expand Down
2 changes: 1 addition & 1 deletion filter/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isObservable, Observable } from "@observable/core";
import { from } from "@observable/from";

/**
* Filters {@linkcode Value|values} that satisfy the given {@linkcode predicate} function.
* [Pushes](https://jsr.io/@observable/core#push) {@linkcode Value|values} that satisfy the given {@linkcode predicate} function.
* @example
* ```ts
* import { filter } from "@observable/filter";
Expand Down
Loading
Loading