MCPcopy Index your code
hub / github.com/caseywebdev/react-list / trackUsedThenable

Function trackUsedThenable

docs/index.js:6177–6227  ·  view source on GitHub ↗
(thenableState, thenable, index)

Source from the content-addressed store, hash-verified

6175}
6176function noop$3() {}
6177function trackUsedThenable(thenableState, thenable, index) {
6178 index = thenableState[index];
6179 void 0 === index
6180 ? thenableState.push(thenable)
6181 : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index));
6182 switch (thenable.status) {
6183 case "fulfilled":
6184 return thenable.value;
6185 case "rejected":
6186 thenableState = thenable.reason;
6187 if (thenableState === SuspenseException)
6188 throw Error(formatProdErrorMessage(483));
6189 throw thenableState;
6190 default:
6191 if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
6192 else {
6193 thenableState = workInProgressRoot;
6194 if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
6195 throw Error(formatProdErrorMessage(482));
6196 thenableState = thenable;
6197 thenableState.status = "pending";
6198 thenableState.then(
6199 function (fulfilledValue) {
6200 if ("pending" === thenable.status) {
6201 var fulfilledThenable = thenable;
6202 fulfilledThenable.status = "fulfilled";
6203 fulfilledThenable.value = fulfilledValue;
6204 }
6205 },
6206 function (error) {
6207 if ("pending" === thenable.status) {
6208 var rejectedThenable = thenable;
6209 rejectedThenable.status = "rejected";
6210 rejectedThenable.reason = error;
6211 }
6212 }
6213 );
6214 }
6215 switch (thenable.status) {
6216 case "fulfilled":
6217 return thenable.value;
6218 case "rejected":
6219 thenableState = thenable.reason;
6220 if (thenableState === SuspenseException)
6221 throw Error(formatProdErrorMessage(483));
6222 throw thenableState;
6223 }
6224 suspendedThenable = thenable;
6225 throw SuspenseException;
6226 }
6227}
6228var suspendedThenable = null;
6229function getSuspendedThenable() {
6230 if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));

Callers 2

unwrapThenableFunction · 0.85
useThenableFunction · 0.85

Calls 2

formatProdErrorMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…