@yci/cached-get
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Build Status Coverage Status MIT license

@yci/cached-get

Installation

  1. Install the Ionic plugin
 npm i -S @yci/cached-get
  1. Add it to your app’s NgModule.
// Import your library
import { CachedGetModule } from '@yci/cached-get';

@NgModule({

  ...

  imports: [

    ...

    // Specify your library as an import
    CachedGetModule.forRoot()
  ],
  
  ...

})
export class AppModule { }

Usage

Once your library is imported, you can use its service in your Angular application:

import { CachedGet } from '@yci/cached-get';
import 'rxjs/add/operator/map';

constructor(private cg: CachedGet) {

  cg.get('http://example.com/xxx')
    .map(x => JSON.stringify(x))
    .subscribe(x => {
      // do your stuff
    }, e => {
      // handle errors
    });

  // with custom headers
  cg.get('http://example.com/xxx', { 'Content-type': 'xxx' })
    .map(x => JSON.stringify(x))
    .subscribe(x => {
      // do your stuff
    }, e => {
      // handle errors
    });

}

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

License

MIT © Yu Chen

Readme

Keywords

Package Sidebar

Install

npm i @yci/cached-get

Weekly Downloads

0

Version

1.0.5

License

MIT

Last publish

Collaborators

  • kuyoonjo