1.1.2 • Published 3 years ago

@esign/json-fetcher v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

jsonFetcher

NPM package for managing data from an API.

Installation

Install package:

npm i @esign/json-fetcher

Import package in Javascript file:

import JsonFetcher from '@esign/json-fetcher';

Create new JsonFetcher instance:

const instance = new JsonFetcher();

Pass options to JsonFetcher class:

const instance = new JsonFetcher({
  element: '.js-json-fetcher',
  template: '.js-json-fetcher__template',
  api: API_URL,
  keys: ['url', 'photo'],
});

Replace API_URL with your api url

Options:

propertydefaultattribute-way
elementnull/
template'.js-json-fetcher__template'/
apinull'data-api'
keysnull'data-keys'