()
| 19 | * The storage provider for hooks. Each invocation increases index i. Data is stored in an array. |
| 20 | */ |
| 21 | export const useSequentialScope = <T>(): SequentialScope<T> => { |
| 22 | const iCtx = useInvokeContext(); |
| 23 | const hostElement = iCtx.$hostElement$; |
| 24 | const elCtx = getContext(hostElement, iCtx.$renderCtx$.$static$.$containerState$); |
| 25 | const seq = (elCtx.$seq$ ||= []); |
| 26 | const i = iCtx.$i$++; |
| 27 | |
| 28 | const set = (value: T) => { |
| 29 | if (qDev && qSerialize) { |
| 30 | verifySerializable(value); |
| 31 | } |
| 32 | return (seq[i] = value); |
| 33 | }; |
| 34 | |
| 35 | return { |
| 36 | val: seq[i], |
| 37 | set, |
| 38 | i, |
| 39 | iCtx, |
| 40 | elCtx, |
| 41 | }; |
| 42 | }; |
no test coverage detected
searching dependent graphs…