MCPcopy Index your code
hub / github.com/dataease/SQLBot / createSubscription

Function createSubscription

frontend/public/swagger-ui-bundle.js:56707–56783  ·  view source on GitHub ↗
(s, o)

Source from the content-addressed store, hash-verified

56705 s()
56706 }
56707 var Ak = { notify() {}, get: () => [] }
56708 function createSubscription(s, o) {
56709 let i,
56710 a = Ak,
56711 u = 0,
56712 _ = !1
56713 function handleChangeWrapper() {
56714 w.onStateChange && w.onStateChange()
56715 }
56716 function trySubscribe() {
56717 ;(u++,
56718 i ||
56719 ((i = o ? o.addNestedSub(handleChangeWrapper) : s.subscribe(handleChangeWrapper)),
56720 (a = (function createListenerCollection() {
56721 let s = null,
56722 o = null
56723 return {
56724 clear() {
56725 ;((s = null), (o = null))
56726 },
56727 notify() {
56728 defaultNoopBatch(() => {
56729 let o = s
56730 for (; o; ) (o.callback(), (o = o.next))
56731 })
56732 },
56733 get() {
56734 const o = []
56735 let i = s
56736 for (; i; ) (o.push(i), (i = i.next))
56737 return o
56738 },
56739 subscribe(i) {
56740 let a = !0
56741 const u = (o = { callback: i, next: null, prev: o })
56742 return (
56743 u.prev ? (u.prev.next = u) : (s = u),
56744 function unsubscribe() {
56745 a &&
56746 null !== s &&
56747 ((a = !1),
56748 u.next ? (u.next.prev = u.prev) : (o = u.prev),
56749 u.prev ? (u.prev.next = u.next) : (s = u.next))
56750 }
56751 )
56752 },
56753 }
56754 })())))
56755 }
56756 function tryUnsubscribe() {
56757 ;(u--, i && 0 === u && (i(), (i = void 0), a.clear(), (a = Ak)))
56758 }
56759 const w = {
56760 addNestedSub: function addNestedSub(s) {
56761 trySubscribe()
56762 const o = a.subscribe(s)
56763 let i = !1
56764 return () => {

Callers 2

ConnectFunctionFunction · 0.85
fOFunction · 0.85

Calls 3

trySubscribeFunction · 0.85
tryUnsubscribeFunction · 0.85
oFunction · 0.70

Tested by

no test coverage detected