Releases: fastify/light-my-request
Releases · fastify/light-my-request
v3.4.1
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1
// callback
inject(dispatch, { method: 'get', url: '/' }, (res) => {
console.log(res.payload)
})
// promises
inject(dispatch, { method: 'get', url: '/' })
.then(res => console.log(res.payload))
// async-await
const res = await inject(dispatch, { method: 'get', url: '/' })
console.log(res.payload)
v2
// callback
inject(dispatch, { method: 'get', url: '/' }, (err, res) => {
console.log(res.payload)
})
// promises
inject(dispatch, { method: 'get', url: '/' })
.then(res => console.log(res.payload))
.catch(console.log)
// async-await
try {
const res = await inject(dispatch, { method: 'get', url: '/' })
console.log(res.payload)
} catch (err) {
console.log(err)
}