@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 2 kB
JavaScript
module.exports=function(t){function o(e){if(r[e])return r[e].exports;var n=r[e]={exports:{},id:e,loaded:!1};return t[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var r={};return o.m=t,o.c=r,o.p="",o(0)}({0:function(t,o,r){t.exports=r(1052)},3:function(t,o){t.exports=function(){throw Error("define cannot be used indirect")}},1015:function(t,o){t.exports=require("./kendo.data")},1052:function(t,o,r){var e,n,i;!function(s,define){n=[r(1015)],e=s,i="function"==typeof e?e.apply(o,n):e,!(void 0!==i&&(t.exports=i))}(function(){return function(t){function o(t){return t&&n(t.done)&&n(t.fail)}function r(t){return t&&n(t.then)&&n(t["catch"])}var e=window.kendo,n=e.isFunction,i=e.data.RemoteTransport.extend({init:function(t){var n,i=t&&t.signalr?t.signalr:{},s=i.promise;if(!s)throw Error('The "promise" option must be set.');if(!o(s)&&!r(s))throw Error('The "promise" option must be a Promise.');if(this.promise=s,n=i.hub,!n)throw Error('The "hub" option must be set.');if("function"!=typeof n.on||"function"!=typeof n.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=n,e.data.RemoteTransport.fn.init.call(this,t)},push:function(t){var o=this.options.signalr.client||{};o.create&&this.hub.on(o.create,t.pushCreate),o.update&&this.hub.on(o.update,t.pushUpdate),o.destroy&&this.hub.on(o.destroy,t.pushDestroy)},_crud:function(n,i){var s,u,a=this.hub,c=this.promise,p=this.options.signalr.server;if(!p||!p[i])throw Error(e.format('The "server.{0}" option must be set.',i));s=[p[i]],u=this.parameterMap(n.data,i),t.isEmptyObject(u)||s.push(u),o(c)?c.done(function(){a.invoke.apply(a,s).done(n.success).fail(n.error)}):r(c)&&c.then(function(){a.invoke.apply(a,s).then(n.success)["catch"](n.error)})},read:function(t){this._crud(t,"read")},create:function(t){this._crud(t,"create")},update:function(t){this._crud(t,"update")},destroy:function(t){this._crud(t,"destroy")}});t.extend(!0,e.data,{transports:{signalr:i}})}(window.kendo.jQuery),window.kendo},r(3))}});