1.0.2 • Published 7 years ago

fronto-api v1.0.2

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

Fronto Api

Basic wrapper for the fetch api, you can pass this object into a fronto-connect instance

Basic Usage

import { Connect } from 'fronto-connect';
import api from 'fronto-api';

class Store extends Connect {
  namespace = 'api/v1';
  resource = 'resource';
}

const source = api({
  endpoint: 'https://endpoint',
  header: (h) => {
    h.append('Some-Key', someValue);
  },
  request: {
    credentials: 'same-origin',
  }
});

new Store(source);