siren-client-fns
v0.2.0
Published
## WARNING: in development, there are edge cases uncoevered, it is not ready for production
Downloads
2
Readme
Siren Client Fns 🚨
WARNING: in development, there are edge cases uncoevered, it is not ready for production
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'
});