Skip to content

Releases: fastify/light-my-request

v2.0.0

07 Jan 12:16

Choose a tag to compare

  • Added error handling - #10 #11

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)
}

v1.1.2

30 Dec 11:32

Choose a tag to compare

  • Use safe-buffer for Node 4 compatibility (fix #8) - #9

v1.1.1

15 Nov 14:41

Choose a tag to compare

  • Set content length to string - #5

v1.1.0

07 Nov 09:31

Choose a tag to compare

  • Bind a server instance to dispatchFunc - #4

v1.0.0

28 Sep 13:21

Choose a tag to compare

Initial release.