This package has been archived, and as such it is read-only.
@xan/async-subject@0.2.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Works with
•JSR Score100%•This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun




Downloads1/wk
•Publisheda month ago (0.2.0)
A lightweight, RxJS-inspired library implementing the Observer pattern in JavaScript. Features AsyncSubjects with AbortController-based unsubscription, supporting both synchronous and asynchronous producers.
@xan/async-subject
A set of tooling that encapsulates an object that acts as a variant of
Subject to be used if you only care about the final
nexted value (if any) before
return.
Build
Automated by JSR.
Publishing
Automated by .github\workflows\publish.yml.
Running unit tests
Run deno task test or deno task test:ci to execute the unit tests via
Deno.
Example
import { AsyncSubject } from "@xan/async-subject"; import { Observer } from "@xan/observer"; const subject = new AsyncSubject<number>(); subject.next(1); subject.next(2); subject.subscribe(new Observer((value) => console.log(value))); subject.next(3); subject.return(); // Console output: 3 subject.subscribe(new Observer((value) => console.log(value))); // Console output: 3
Glossary And Semantics
Built and signed on
GitHub Actions
Add Package
deno add jsr:@xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";
Import directly with a jsr specifier
import * as async_subject from "jsr:@xan/async-subject";
Add Package
pnpm i jsr:@xan/async-subject
pnpm dlx jsr add @xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";
Add Package
yarn add jsr:@xan/async-subject
yarn dlx jsr add @xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";
Add Package
vlt install jsr:@xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";
Add Package
npx jsr add @xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";
Add Package
bunx jsr add @xan/async-subject
Import symbol
import * as async_subject from "@xan/async-subject";