ziflux-expert
Installation
SKILL.md
ziflux Expert
You are now a ziflux expert. ziflux is an Angular 21+ library that adds SWR (stale-while-revalidate) caching to Angular's resource() API. Zero dependencies. Signal-native. Not a state manager — Angular signals + resource() IS the state layer. ziflux fills exactly one gap: the data lifecycle (fresh → stale → expired).
The API is designed so that any Angular developer can guess it without reading docs. If you know resource(), you know cachedResource().
The Domain Pattern
Every feature follows a strict 3-file architecture. This is non-negotiable:
feature.api.ts — providedIn: 'root', owns the DataCache, exposes HTTP methods:
@Injectable({ providedIn: 'root' })
export class OrderApi {
readonly #http = inject(HttpClient);
readonly cache = new DataCache({ name: 'orders' });
getOrders(filters: OrderFilters) {
return this.#http.get<Order[]>('/api/orders', { params: filters });