0.0.4 • Published 8 years ago

frontflesh-service v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

frontflesh-service

Install

$ npm install frontflesh-service

Usage

import Service from 'frontflesh/service/Service';

class HttpService extends Service {
  fetch(fetchOptions = {}) {
    const promise = new Promise(() => {
      // (...)
    });
    // (...)
    return promise;
  }
}

// use the singleton (inherited by the Service class)
HttpService.get().fetch({ url: 'http://www.google.fr', headers: { 'Content-Type': 'text/html; charset=utf-8' } })
  .then(function () {
    // (...)
  });
// or if you need something more specific
let myService = new HttpService({ 'cache-capacity': 1200 });
myService.fetch({ url: 'http://www.google.fr', headers: { 'Content-Type': 'text/html; charset=utf-8' } })
  .then(function () {
    // (...)
  });
0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago