Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 474 Bytes

File metadata and controls

27 lines (21 loc) · 474 Bytes

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);