ecma7-koa2-starter icon indicating copy to clipboard operation
ecma7-koa2-starter copied to clipboard

Channels

Open ptariche opened this issue 7 years ago • 0 comments

An introduction to utilizing Channels with the starter

ctx.state.channel.channels.send(['FUNCTION_NAME', 'ARGUMENTS']);
ctx.state.channel.channels.send(['request.get', 'http://yahoo.com']);

Set Channel Functions

class ChannelLambda {
  static build (ctx) {
    ctx.state.channel.fn['request.get']  = require('./../helpers/').request.get;
    ctx.state.channel.fn['request.post'] = require('./../helpers/').request.post;
    return ctx.state.channel.fn;
  };
};

module.exports = ChannelLambda.build;

ptariche avatar Oct 31 '16 16:10 ptariche