API Docs for: 1.0.0
Show:

RPC.Mojito Class

RPC wrapper for Mojit proxy. This allows you to use either Y.RPC.JSON or Y.RPC.Mojito interchangeably. The method in the Mojit proxy receives the parameters as an array in body.params. You can pass this to the model as follows: model.getItems.apply(model, ac.params.getFromBody().params)

Constructor

RPC.Mojito

(
  • config
)

Parameters:

  • config Object
    • url Object

      the mojit proxy (parameter named to match Y.jsonrpc)

    • methods Array

      (optional) method names, so you don't have to use exec

Item Index

Methods

Methods

addMethod

(
  • rpc
  • name
  • force
)
static

Adds the named method to the given rpc object.

Parameters:

  • rpc RPC.Mojito

    rpc object

  • name String

    name of method

  • force Boolean

    pass true to override existing method

exec

(
  • method
  • params
  • callback
)
async

Executes the named method via the mojitProxy and invokes the callback when the result is received.

Parameters:

  • method String

    the name of the function to execute via the mojitProxy

  • params Array

    array of arguments for the method

  • callback Function | Object

    (optional) function to call on success or object specifying {context,on:{success,failure}}

mojito

(
  • proxy
  • method
  • params
  • callback
  • config
)
static async

Parameters:

  • proxy Object

    the mojit proxy

  • method String

    the name of the function to execute via the mojitProxy

  • params Array

    array of arguments for the method

  • callback Function | Object

    (optional) function to call on success or object specifying {context,on:{success,failure}}

  • config Object

    config object passed to Y.RPC.Mojito constructo