Skip to content

Commit

Permalink
Merge b8d2ba8 into 2a13064
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Mar 18, 2018
2 parents 2a13064 + b8d2ba8 commit b1f7085
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Request.js
Expand Up @@ -13,13 +13,15 @@ export const ev = R.curry(($, event) =>
)

export const RequestParams = R.curry((request, params) => {
return O.create(observer =>
request(params)
return O.create(observer => {
const req = request(params)
.on('data', message => observer.onNext({event: 'data', message}))
.on('response', message => observer.onNext({event: 'response', message}))
.on('complete', () => observer.onCompleted())
.on('error', error => observer.onError(error))
)

return () => req.abort()
})
})

export const Request = R.curry((request, params) => {
Expand Down

0 comments on commit b1f7085

Please sign in to comment.