Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions can now be a constructed object rather than a literal.
This is lighter from a memory standpoint, especially for large handlers. Example: ``` function RPC(req,res,ss){ this.req = req; this.res = res; this.ss = ss; } RPC.prototype.sendMessage = function(message) { if (message && message.length > 0) { // Check for blank messages this.ss.publish.all('newMessage', message); // Broadcast the message to everyone return this.res(true); // Confirm it was sent to the originating client } else { return this.res(false); } } exports.actions = function(req, res, ss) { req.use('session'); return new RPC(req,res,ss); }; ```
- Loading branch information