UNPKG

kendo-ui-core

Version:

Kendo UI is everything you need to build sites and apps with HTML5 & JavaScript. Kendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great exp

2 lines 1.82 kB
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./core-R4j5Vh3b.js`),require(`./filter-expression-no-eval--xfq8dEO.js`),require(`./kendo.data.js`);const e={id:`data.signalr`,name:`SignalR`,category:`framework`,depends:[`data`],hidden:!0};(function(e){var t=window.kendo,n=t.isFunction;function r(e){return e&&n(e.done)&&n(e.fail)}function i(e){return e&&n(e.then)&&n(e.catch)}var a=t.data.RemoteTransport.extend({init:function(e){var n=e&&e.signalr?e.signalr:{},a=n.promise;if(!a)throw Error(`The "promise" option must be set.`);if(!r(a)&&!i(a))throw Error(`The "promise" option must be a Promise.`);this.promise=a;var o=n.hub;if(!o)throw Error(`The "hub" option must be set.`);if(typeof o.on!=`function`||typeof o.invoke!=`function`)throw Error(`The "hub" option is not a valid SignalR hub proxy.`);this.hub=o,t.data.RemoteTransport.fn.init.call(this,e)},push:function(e){var t=this.options.signalr.client||{};t.create&&this.hub.on(t.create,e.pushCreate),t.update&&this.hub.on(t.update,e.pushUpdate),t.destroy&&this.hub.on(t.destroy,e.pushDestroy)},_crud:function(n,a){var o=this.hub,s=this.promise,c=this.options.signalr.server;if(!c||!c[a])throw Error(t.format(`The "server.{0}" option must be set.`,a));var l=[c[a]],u=this.parameterMap(n.data,a);e.isEmptyObject(u)||l.push(u),r(s)?s.done(function(){o.invoke.apply(o,l).done(n.success).fail(n.error)}):i(s)&&s.then(function(){o.invoke.apply(o,l).then(n.success).catch(n.error)})},read:function(e){this._crud(e,`read`)},create:function(e){this._crud(e,`create`)},update:function(e){this._crud(e,`update`)},destroy:function(e){this._crud(e,`destroy`)}});e.extend(!0,t.data,{transports:{signalr:a}})})(window.kendo.jQuery);var t=kendo;exports.__meta__=e,exports.default=t; //# sourceMappingURL=kendo.data.signalr.js.map