@esign/json-fetcher

1.1.2 • Public • Published

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:

property default attribute-way
element null /
template '.js-json-fetcher__template' /
api null 'data-api'
keys null 'data-keys'

Package Sidebar

Install

npm i @esign/json-fetcher

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

7.48 kB

Total Files

11

Last publish

Collaborators

  • dietervyncke
  • dieter-esign
  • thomascoppein
  • bartdeco
  • jordyvanderhaegen