-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add polling endpoint support #21
Add polling endpoint support #21
Conversation
72719a2
to
8517974
Compare
Added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A couple of comments, but ship if you want :)
/** | ||
* @param {HttpClient} options.httpClient | ||
*/ | ||
function pollingClient(urlBase, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a complex class for just some polling; it seems it is implementing some interface. Add some comment pointing out the interface, guessing it's socket.io interface?
return function wrapper(payload) { | ||
handler(object.toCamelKeys(payload)); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be simpler (and also lighter for the cpu) to handle payload transformation in emitEvents
, and not have to wrap and keep a store of wrapped handlers? ...or even use camel cased keys in emitEvents and just have to camelize error from remote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy paste mistake good point. will remove this and handle that on emitEvents
Adds polling provider and
getState
endpoints