0.2.0 • Published 6 years ago

siren-client-fns v0.2.0

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

Siren Client Fns 🚨

WARNING: in development, there are edge cases uncoevered, it is not ready for production

Build Status Maintainability Test Coverage

siren-client-fns is siren client written in a functional style

How to use

Creating an action

const fetch = require('node-fetch');
const siren = require('siren-client-fns');
const sirenClient = siren(fetch);
const url = 'http://example.com/my-siren-endpoint';

const myAction = await sirenClient.resource(url)
    .then(sirenClient.followEntity(['my-sub-entiy']))
    .then(sirenClient.createAction('my-action-name'));

const sirenResource = await myAction({
    myPropertyPayload: 'myValuePayload'
});