2.0.0 • Published 1 year ago

@aaqilniz/rest-cache v2.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

rest-cache

LoopBack

Installation

Install RestCacheComponent using npm;

$ [npm install | yarn add] @aaqilniz/rest-cache

Basic Use

Configure and load RestCacheComponent in the application constructor as shown below.

import {RestCacheComponent, RestCacheComponentOptions, DEFAULT_REST_CACHE_OPTIONS} from 'rest-cache';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
  constructor(options: ApplicationConfig = {}) {
    const opts: RestCacheComponentOptions = DEFAULT_REST_CACHE_OPTIONS;
    this.configure(RestCacheComponentBindings.COMPONENT).to(opts);
      // Put the configuration options here
    });
    this.component(RestCacheComponent);
    // ...
  }
  // ...
}