This library is a very thin wrapper over the Stackjam API services. Its only goal is to unopinionatedly abstract some of the underlying resource calls, so that the consumer can focus on the what, not the how.
Dependencies
This library utilises the ES6 fetch
API. Polyfilling these libraries is recommended. The simplest way to do this is to use Polyfill.io, but you can do it in whichever way makes the most sense for your project.
To use Polyfill.io, include the following in your HTML:
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=fetch"></script>
Usage
import Stackjam from 'stackjam'
const api = new Stackjam('example')
api.resources.create({
schema: 'test',
content: {
value: 'I am some content'
}
}).then(resource => {
console.log(resource.data)
})
api.resources.list().then(response => {
response.data.map(console.log)
})