
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@andywer/observable-fns
Advanced tools
Light-weight observable implementation and utils written in TypeScript. Based on zen-observable.
Light-weight observable implementation (< 7kB minified) and utils. Based on zen-observable, re-implemented in TypeScript including .pipe() and .tap(). Zero dependencies, tree-shakeable.
An observable is basically a stream of asynchronously emitted values that you can subscribe to. In a sense it is to the event emitter what the promise is to the callback.
The main difference to a promise is that a promise only resolves once, whereas observables can yield different values repeatedly. They can also fail and yield an error, like a promise, and they come with a completion event to indicate that the last value has been sent.
For a quick introduction on how to use observables, check out the zen-observable readme.
import { Observable, multicast } from "@andywer/observable-fns"
function subscribeToServerSentEvents(url) {
// multicast() will make the observable "hot", so multiple
// subscribers will share the same event source
return multicast(new Observable(observer => {
const eventStream = new EventSource(url)
eventStream.addEventListener("message", message => observer.next(message))
eventStream.addEventListener("error", error => observer.error(error))
return () => eventStream.close()
}))
}
subscribeToServerSentEvents("http://localhost:3000/events")
.subscribe(event => console.log("Server sent event:", event))
Keep the observable implementation itself lean, ship the utility functions loosely coupled, so they can be imported as needed.
The aim is to provide a lean, friendly observable implementation with a small footprint that's fit to be used in libraries.
npm install @andywer/observable-fns
You can import whatever you need directly from the package:
import { Observable, flatMap } from "@andywer/observable-fns"
If you write front-end code and care about bundle size, you can either depend on tree-shaking or explicitly import just the parts that you need:
import Observable from "@andywer/observable-fns/observable"
import flatMap from "@andywer/observable-fns/flatMap"
Functions like filter(), flatMap(), map() accept asynchronous handlers – this can be a big win compared to the usual methods on Observable.prototype that only work with synchronous handlers.
Those functions will also make sure that the values are consistently emitted in the same order as the input observable emitted them.
import { Observable, filter } from "@andywer/observable-fns"
const existingGitHubUsersObservable = Observable.from(["andywer", "bcdef", "charlie"])
.pipe(
filter(async name => {
const response = await fetch(`https://github.com/${name}`)
return response.status === 200
})
)
See docs/API.md for an overview of the full API.
MIT
FAQs
Light-weight observable implementation and utils written in TypeScript. Based on zen-observable.
We found that @andywer/observable-fns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.