NPM package for managing data from an API.
npm i @esign/json-fetcher
import JsonFetcher from '@esign/json-fetcher';
const instance = new JsonFetcher();
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
property | default | attribute-way |
---|---|---|
element | null | / |
template | '.js-json-fetcher__template' | / |
api | null | 'data-api' |
keys | null | 'data-keys' |