ronda-utils
v0.0.16
Published
Utils for ronda app
Downloads
3
Readme
How to use
import resources from 'ronda-utils'
const baseURL = 'https://google.com'
const actions = {
test: { method: 'GET', url: '/' }
}
const googleResource = resource(baseURL, actions)
googleResource.test()
.then(res => console.log(res.log))
Default resources
const baseURL = 'https://google.com'
const googleResource = resource(baseURL)
googleResource.get()
.then(res => console.log(res.log))
googleResource.save({ name: 'oi' })
.then(res => console.log(res.log))
googleResource.query({ id: 1 })
.then(res => console.log(res.log))
googleResource.update({ id: 1, name: 'hi' })
.then(res => console.log(res.log))
googleResource.remove({ id: 1 })
.then(res => console.log(res.log))
googleResource.delete({ id: 1 })
.then(res => console.log(res.log))