1.1.2 • Published 5 years ago
@esign/json-fetcher v1.1.2
jsonFetcher
NPM package for managing data from an API.
Installation
Install package:
npm i @esign/json-fetcherImport 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:
| property | default | attribute-way |
|---|---|---|
| element | null | / |
| template | '.js-json-fetcher__template' | / |
| api | null | 'data-api' |
| keys | null | 'data-keys' |