Catalogue / reactive-programming
reactive-programming
MITSignedImplement reactive programming patterns using RxJS, streams, observables, and backpressure handling. Use when building event-driven UIs, handling async data streams, or managing complex data flows.--- name: reactive-programming description: > Implement reactive programming patterns using RxJS, streams, observables, and backpressure handling. Use when building event-driven UIs, handling async data streams, or managing complex data flows. ---
Reactive Programming
Table of Contents
- Overview
- When to Use
- Quick Start
- Reference Guides
- Best Practices
Overview
Build responsive applications using reactive streams and observables for handling asynchronous data flows.
When to Use
- Complex async data flows
- Real-time data updates
- Event-driven architectures
- UI state management
- WebSocket/SSE handling
- Combining multiple data sources
Quick Start
Minimal working example:
import {
Observable,
Subject,
BehaviorSubject,
fromEvent,
interval,
} from "rxjs";
import {
map,
filter,
debounceTime,
distinctUntilChanged,
switchMap,
} from "rxjs/operators";
// Create observable from array
const numbers$ = new Observable<number>((subscriber) => {
subscriber.next(1);
subscriber.next(2);
subscriber.next(3);
subscriber.complete();
});
numbers$.subscribe({
next: (value) => console.log(value),
// ... (see reference guides for full implementation)Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | RxJS Basics | RxJS Basics | | Search with Debounce | Search with Debounce | | State Management | State Management | | WebSocket with Reconnection | WebSocket with Reconnection | | Combining Multiple Streams | Combining Multiple Streams | | Backpressure Handling | Backpressure Handling | | Custom Operators | Custom Operators |
Best Practices
✅ DO
- Unsubscribe to prevent memory leaks
- Use operators to transform data
- Handle errors properly
- Use shareReplay for expensive operations
- Combine streams when needed
- Test reactive code
❌ DON'T
- Subscribe multiple times to same observable
- Forget to unsubscribe
- Use nested subscriptions
- Ignore error handling
- Make observables stateful
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 2.4 kB | 39b85c4ed3d7 |
| SKILVAULT_SOURCE.json | 2.1 kB | f48c22e327c8 |
| THIRD_PARTY_NOTICES.md | 1.1 kB | ad2a48bad631 |
| references/backpressure-handling.md | 697 B | 297409fcaabc |
| references/combining-multiple-streams.md | 1.1 kB | bb32f51b7ed6 |
| references/custom-operators.md | 603 B | 201261590fa2 |
| references/rxjs-basics.md | 1.2 kB | 397dcf8faf12 |
| references/search-with-debounce.md | 958 B | 6b5b7c6f1bad |
| references/state-management.md | 1.7 kB | cc1d7219eaba |
| references/websocket-with-reconnection.md | 1.4 kB | 0d14d79b9da5 |
| templates/component-template.tsx | 318 B | d40c576737ae |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 3f5182cfd739 | 20 Nov 2026 |
Locking a skill to one version needs Pro.