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

Function trySubscribe

frontend/public/swagger-ui-bundle.js:56715–56754  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)))

Callers 1

createSubscriptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected