src/client/createProxiedMethod.js
function proxiedMethod(params, path) {

  // Get the arguments that should be passed to the server
  var payload = Array.prototype.slice.call(arguments).slice(2);

    // Save the callback function for later use
  var callback = util.firstFunction(payload);

  // Transform the callback function in the arguments into a special key
  // that will be used in the server to signal the client-side callback call
  payload = util.serializeCallback(payload);

  var endpoint = buildEndpoint(params, path);

  if (callback) {
    return doRequest(endpoint, payload, params, callback);
  } else {
    return util.promisify(doRequest)(endpoint, payload, params);
  }
}
function proxiedMethod(params, path) {

  // Get the arguments that should be passed to the server
  var payload = Array.prototype.slice.call(arguments).slice(2);

    // Save the callback function for later use
  var callback = util.firstFunction(payload);

  // Transform the callback function in the arguments into a special key
  // that will be used in the server to signal the client-side callback call
  payload = util.serializeCallback(payload);

  var endpoint = buildEndpoint(params, path);

  if (callback) {
    return doRequest(endpoint, payload, params, callback);
  } else {
    return util.promisify(doRequest)(endpoint, payload, params);
  }
}
function proxiedMethod ( params , path ) { // Get the arguments that should be passed to the server var payload = Array . prototype . slice . call ( arguments ) . slice ( 2 ) ; // Save the callback function for later use var callback = util . firstFunction ( payload ) ; // Transform the callback function in the arguments into a special key // that will be used in the server to signal the client-side callback call payload = util . serializeCallback ( payload ) ; var endpoint = buildEndpoint ( params , path ) ; if ( callback ) { return doRequest ( endpoint , payload , params , callback ) ; } else { return util . promisify ( doRequest ) ( endpoint , payload , params ) ; } }
Serializes the parameters sent in the function's call,
and sends a POST request to isomorphine's endpoint in the server.

@param  {Object}  params  The server's configuration and error handlers.
@param  {Object}  path    The path to the serverside method to be called.
Serializes the parameters sent in the function s call and sends a POST request to isomorphine s endpoint in the server .