MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / Resource

Function Resource

06.Router/basic/js/vue-resource.js:1196–1213  ·  view source on GitHub ↗
(url, params, actions, options)

Source from the content-addressed store, hash-verified

1194 });
1195
1196 function Resource(url, params, actions, options) {
1197
1198 var self = this || {},
1199 resource = {};
1200
1201 actions = assign({}, Resource.actions, actions);
1202
1203 each(actions, function (action, name) {
1204
1205 action = merge({ url: url, params: params || {} }, options, action);
1206
1207 resource[name] = function () {
1208 return (self.$http || Http)(opts(action, arguments));
1209 };
1210 });
1211
1212 return resource;
1213 }
1214
1215 function opts(action, args) {
1216

Callers

nothing calls this directly

Calls 3

eachFunction · 0.70
mergeFunction · 0.70
optsFunction · 0.70

Tested by

no test coverage detected