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

Function createStore

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

Source from the content-addressed store, hash-verified

30748 return Object.getPrototypeOf(s) === o || null === Object.getPrototypeOf(s)
30749 }
30750 function createStore(s, o, i) {
30751 if ('function' != typeof s) throw new Error(formatProdErrorMessage(2))
30752 if (
30753 ('function' == typeof o && 'function' == typeof i) ||
30754 ('function' == typeof i && 'function' == typeof arguments[3])
30755 )
30756 throw new Error(formatProdErrorMessage(0))
30757 if (('function' == typeof o && void 0 === i && ((i = o), (o = void 0)), void 0 !== i)) {
30758 if ('function' != typeof i) throw new Error(formatProdErrorMessage(1))
30759 return i(createStore)(s, o)
30760 }
30761 let a = s,
30762 u = o,
30763 _ = new Map(),
30764 w = _,
30765 x = 0,
30766 C = !1
30767 function ensureCanMutateNextListeners() {
30768 w === _ &&
30769 ((w = new Map()),
30770 _.forEach((s, o) => {
30771 w.set(o, s)
30772 }))
30773 }
30774 function getState() {
30775 if (C) throw new Error(formatProdErrorMessage(3))
30776 return u
30777 }
30778 function subscribe(s) {
30779 if ('function' != typeof s) throw new Error(formatProdErrorMessage(4))
30780 if (C) throw new Error(formatProdErrorMessage(5))
30781 let o = !0
30782 ensureCanMutateNextListeners()
30783 const i = x++
30784 return (
30785 w.set(i, s),
30786 function unsubscribe() {
30787 if (o) {
30788 if (C) throw new Error(formatProdErrorMessage(6))
30789 ;((o = !1), ensureCanMutateNextListeners(), w.delete(i), (_ = null))
30790 }
30791 }
30792 )
30793 }
30794 function dispatch(s) {
30795 if (!isPlainObject(s)) throw new Error(formatProdErrorMessage(7))
30796 if (void 0 === s.type) throw new Error(formatProdErrorMessage(8))
30797 if ('string' != typeof s.type) throw new Error(formatProdErrorMessage(17))
30798 if (C) throw new Error(formatProdErrorMessage(9))
30799 try {
30800 ;((C = !0), (u = a(u, s)))
30801 } finally {
30802 C = !1
30803 }
30804 return (
30805 (_ = w).forEach((s) => {
30806 s()
30807 }),

Callers 1

Calls 3

formatProdErrorMessageFunction · 0.85
iFunction · 0.70
dispatchFunction · 0.70

Tested by

no test coverage detected