Agent skill
rxjs-patterns
Master RxJS in Angular with observables, operators, subjects, error handling, and reactive patterns for building responsive applications.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/design/rxjs-patterns-spjoshis-claude-code-plugins
SKILL.md
RxJS Patterns in Angular
Master reactive programming in Angular with RxJS observables, operators, and best practices.
Core Patterns
Observable Creation
import { Observable, of, from, interval } from 'rxjs';
// From array
const numbers$ = from([1, 2, 3, 4]);
// From promise
const user$ = from(fetch('/api/user'));
// Interval
const timer$ = interval(1000);
Operators
import { map, filter, switchMap, catchError } from 'rxjs/operators';
this.http.get<User[]>('/api/users').pipe(
map(users => users.filter(u => u.active)),
catchError(error => of([]))
).subscribe(users => console.log(users));
Service Pattern
@Injectable({ providedIn: 'root' })
export class UserService {
private users$ = new BehaviorSubject<User[]>([]);
getUsers(): Observable<User[]> {
return this.http.get<User[]>('/api/users').pipe(
tap(users => this.users$.next(users)),
catchError(this.handleError)
);
}
private handleError(error: HttpErrorResponse): Observable<never> {
console.error('Error:', error);
return throwError(() => new Error('Something went wrong'));
}
}
Best Practices
- Unsubscribe to prevent memory leaks
- Use async pipe in templates
- Handle errors with catchError
- Use shareReplay for caching
- Avoid nested subscriptions
- Use switchMap for HTTP requests
Resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?