/* esm.sh - @assistant-ui/tap@0.9.24/dist/react-hooks/useEffect */
import{getCurrentResourceFiber as c}from"../core/helpers/execution-context.mjs";import{addCommit as d}from"../core/helpers/root.mjs";import{throwHookOrderChanged as l,throwRenderedMoreHooks as u}from"./utils/hookErrors.mjs";var p=n=>({type:n,setup:void 0,setupDeps:void 0,cleanup:void 0,deps:null,generation:0});function h(n,o,i){let s=c(),r=s.currentIndex++,t=s.cells[r],e=t===void 0?p(i):t.type===i?t:l();if(t===void 0&&(s.isFirstRender||u(),s.cells[r]=e,i==="insertion"?(s.insertionCells??=[]).push(e):s.effectCells.push(e)),e.deps!==null&&!!o!=!!e.deps)throw new Error("useEffect called with and without dependencies across re-renders");let f=s.isRefreshing;d(s,()=>{e.setup=n,e.setupDeps=o,f&&(e.deps=null),e.generation++})}function w(n,o){h(n,o,"effect")}export{w as useEffect,h as useEffectImpl};
//# sourceMappingURL=useEffect.mjs.map