data
Laurel & Wolf Data
Install
npm install lw-data --save
Usage
HTTP
import {sdk, serialize} from 'lw-data'
let api = sdk({
headers: {
custom : 'header'
}
})
api()
.projects()
.get()
.then(res => {
let resources = serialize.response(res.body);
console.log(resources);
})
Streaming
import {sdk} from 'lw-data'
let api = sdk({
headers: {
custom : 'header'
}
})
api.createStream(({headers}) => {
})
api()
.projects()
.stream('created')
.subscribe(res => {
})
api.createStream(({headers}) => {
})
api()
.submissions()
.stream()
.subscribe(res => {
})