1.0.1 • Published 5 years ago

restbee v1.0.1

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

NPM version Codecov CircleCI Travis AppVeyor GitHub stars

Restbee

JSON data normalizer/cacher based on axios. Currently support JSONAPI.

Quick start

import { cachedRecords, createService, JsonApiNormalizer } from 'restbee';

const normalizer = new JsonApiNormalizer(cachedRecords);
const apiService = createService(
  'http://localhost/api/endpoint', 
  normalizer.parse, 
  normalizer.parErrors)

... ...

await postKey = apiService.get('posts/123')
const post = cachedRecords[postKey]
# {
#   id: 123,
#   type: 'post',
#   title: 'test title',
#   content: 'post content',
#   userKey: 'user_3'
# } 
1.0.1

5 years ago

1.0.0

5 years ago