1.0.1 • Published 5 years ago
restbee v1.0.1
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'
# }