"use strict";Liferay.Loader.define("portal-workflow-kaleo-designer-web$react-redux@7.2.8/lib/utils/Subscription",["module","exports","require","./batch"],(function(e,n,r){window,n.__esModule=!0,n.createSubscription=function createSubscription(e,n){var r,i=u;function handleChangeWrapper(){c.onStateChange&&c.onStateChange()}function trySubscribe(){r||(r=n?n.addNestedSub(handleChangeWrapper):e.subscribe(handleChangeWrapper),i=function createListenerCollection(){var e=(0,t.getBatch)(),n=null,r=null;return{clear:function clear(){n=null,r=null},notify:function notify(){e((function(){for(var e=n;e;)e.callback(),e=e.next}))},get:function get(){for(var e=[],r=n;r;)e.push(r),r=r.next;return e},subscribe:function subscribe(e){var t=!0,u=r={callback:e,next:null,prev:r};return u.prev?u.prev.next=u:n=u,function unsubscribe(){t&&null!==n&&(t=!1,u.next?u.next.prev=u.prev:r=u.prev,u.prev?u.prev.next=u.next:n=u.next)}}}}())}var c={addNestedSub:function addNestedSub(e){return trySubscribe(),i.subscribe(e)},notifyNestedSubs:function notifyNestedSubs(){i.notify()},handleChangeWrapper:handleChangeWrapper,isSubscribed:function isSubscribed(){return Boolean(r)},trySubscribe:trySubscribe,tryUnsubscribe:function tryUnsubscribe(){r&&(r(),r=void 0,i.clear(),i=u)},getListeners:function getListeners(){return i}};return c};var t=r("./batch"),u={notify:function notify(){},get:function get(){return[]}}}));
//# sourceMappingURL=Subscription.js.map