Open codeliner opened 9 years ago
Depends on #47
Simplify API requests by providing a command and a query module to perform requests.
Here is a prototype of a command module:
(function (root, factory) { if (typeof define === 'function' && define.amd) { define(['http', 'apiDefinition'], factory); } else { root.command = factory(root.http, root.apiDefinition); } }(this, function (http, apiDefinition /* @TODO: add promise dependency */) { function command (name) { var self = this; self.name = name; self.setPayload = function (payload) { self.payload = payload; } self.send = function () { //@TODO return promise http.post(apiDefinition.getCommandUrl(self.name), self.payload) } } return command; }));
Depends on #47
Simplify API requests by providing a command and a query module to perform requests.
Here is a prototype of a command module: