koding / kite.js

Kite client in JavaScript
kite.koding.com
MIT License
75 stars 16 forks source link

Wrap api methods with a custom one to remove need for rewriting protocol #66

Closed usirin closed 6 years ago

usirin commented 6 years ago

This removes the need for munging callbacks etc.

Instead of us rewriting the protocol, we are simply wrapping each function with a one that can understand the way we are sending messages, and transforms this dnode-request into our function calls by simply sending arguments in the correct order.

This also adds the request info as the last argument to the method handlers.

usirin commented 6 years ago

@gokmen let's merge this i will send other changes in another pr.