Skip to content

guillermocorrea/ng-cacheable

Repository files navigation

@guillermocorrea/cacheable

Build Status codecov

Angular method decorator to cache Observable results.

Install

npm i @guillermocorrea/cacheable

Example

import {cacheable} from '@guillermocorrea/cacheable';

@Injectable({
  providedIn: 'root'
})
export class TodoService {
  constructor(private http: HttpClient) {}

  @cacheable()
  getTodo(id: number) {
    return this.http.get(`https://jsonplaceholder.typicode.com/todos/${id}`);
  }
}

About

Angular cache decorator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published