[{"data":1,"prerenderedAt":398},["ShallowReactive",2],{"navigation":3,"-frameworks-svelte":65,"-frameworks-svelte-surround":395},[4,15,29,47],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Omni Async","\u002Fguide","1.guide\u002F1.index",[9,11],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-book-open",{"title":12,"path":13,"stem":14,"icon":10},"Quick start","\u002Fguide\u002Fquick-start","1.guide\u002F2.quick-start",{"title":16,"path":17,"stem":18,"children":19},"Async state","\u002Fconcepts","2.concepts\u002F1.index",[20,21,25],{"title":16,"path":17,"stem":18},{"title":22,"path":23,"stem":24},"Concurrency and cancellation","\u002Fconcepts\u002Fconcurrency-and-cancellation","2.concepts\u002F2.concurrency-and-cancellation",{"title":26,"path":27,"stem":28},"Notifications and equality","\u002Fconcepts\u002Fnotifications","2.concepts\u002F3.notifications",{"title":30,"path":31,"stem":32,"children":33},"Framework adapters","\u002Fframeworks","3.frameworks\u002F1.index",[34,35,39,43],{"title":30,"path":31,"stem":32},{"title":36,"path":37,"stem":38},"React","\u002Fframeworks\u002Freact","3.frameworks\u002F2.react",{"title":40,"path":41,"stem":42},"Vue","\u002Fframeworks\u002Fvue","3.frameworks\u002F3.vue",{"title":44,"path":45,"stem":46},"Svelte","\u002Fframeworks\u002Fsvelte","3.frameworks\u002F4.svelte",{"title":48,"path":49,"stem":50,"children":51},"Core API","\u002Fapi","4.api\u002F1.index",[52,53,57,61],{"title":48,"path":49,"stem":50},{"title":54,"path":55,"stem":56},"React API","\u002Fapi\u002Freact","4.api\u002F2.react",{"title":58,"path":59,"stem":60},"Vue API","\u002Fapi\u002Fvue","4.api\u002F3.vue",{"title":62,"path":63,"stem":64},"Svelte API","\u002Fapi\u002Fsvelte","4.api\u002F4.svelte",{"id":66,"title":44,"body":67,"description":80,"extension":390,"meta":391,"navigation":392,"path":45,"seo":393,"stem":46,"__hash__":394},"content\u002F3.frameworks\u002F4.svelte.md",{"type":68,"value":69,"toc":386},"minimark",[70,74,100,105,253,267,271,368,382],[71,72,73],"p",{},"Install the adapter alongside Svelte 5:",[75,76,81],"pre",{"className":77,"code":78,"language":79,"meta":80,"style":80},"language-bash shiki shiki-themes github-light github-dark github-dark","pnpm add @omni-async\u002Fsvelte\n","bash","",[82,83,84],"code",{"__ignoreMap":80},[85,86,89,93,97],"span",{"class":87,"line":88},"line",1,[85,90,92],{"class":91},"shcOC","pnpm",[85,94,96],{"class":95},"sfrk1"," add",[85,98,99],{"class":95}," @omni-async\u002Fsvelte\n",[101,102,104],"h2",{"id":103},"query-stores","Query stores",[75,106,110],{"className":107,"code":108,"language":109,"meta":80,"style":80},"language-svelte shiki shiki-themes github-light github-dark github-dark","\u003Cscript lang=\"ts\">\n  import { useQuery } from \"@omni-async\u002Fsvelte\";\n\n  const { data, error, loading, trigger } = useQuery(\n    async (team: string) => {\n      const response = await fetch(`\u002Fapi\u002Fteams\u002F${team}\u002Fusers`);\n      if (!response.ok) throw new Error(\"Unable to load users\");\n      return response.json() as Promise\u003Cstring[]>;\n    },\n    { initial: () => [] },\n  );\n\u003C\u002Fscript>\n\n\u003Cbutton disabled={$loading} onclick={() => trigger(\"platform\")}>\n  Load users\n\u003C\u002Fbutton>\n\n{#if $error}\n  \u003Cp>Unable to load users\u003C\u002Fp>\n{\u002Fif}\n\n{#each $data as user}\n  \u003Cp>{user}\u003C\u002Fp>\n{\u002Feach}\n","svelte",[82,111,112,117,123,130,136,142,148,154,160,166,172,178,184,189,195,201,207,212,218,224,230,235,241,247],{"__ignoreMap":80},[85,113,114],{"class":87,"line":88},[85,115,116],{},"\u003Cscript lang=\"ts\">\n",[85,118,120],{"class":87,"line":119},2,[85,121,122],{},"  import { useQuery } from \"@omni-async\u002Fsvelte\";\n",[85,124,126],{"class":87,"line":125},3,[85,127,129],{"emptyLinePlaceholder":128},true,"\n",[85,131,133],{"class":87,"line":132},4,[85,134,135],{},"  const { data, error, loading, trigger } = useQuery(\n",[85,137,139],{"class":87,"line":138},5,[85,140,141],{},"    async (team: string) => {\n",[85,143,145],{"class":87,"line":144},6,[85,146,147],{},"      const response = await fetch(`\u002Fapi\u002Fteams\u002F${team}\u002Fusers`);\n",[85,149,151],{"class":87,"line":150},7,[85,152,153],{},"      if (!response.ok) throw new Error(\"Unable to load users\");\n",[85,155,157],{"class":87,"line":156},8,[85,158,159],{},"      return response.json() as Promise\u003Cstring[]>;\n",[85,161,163],{"class":87,"line":162},9,[85,164,165],{},"    },\n",[85,167,169],{"class":87,"line":168},10,[85,170,171],{},"    { initial: () => [] },\n",[85,173,175],{"class":87,"line":174},11,[85,176,177],{},"  );\n",[85,179,181],{"class":87,"line":180},12,[85,182,183],{},"\u003C\u002Fscript>\n",[85,185,187],{"class":87,"line":186},13,[85,188,129],{"emptyLinePlaceholder":128},[85,190,192],{"class":87,"line":191},14,[85,193,194],{},"\u003Cbutton disabled={$loading} onclick={() => trigger(\"platform\")}>\n",[85,196,198],{"class":87,"line":197},15,[85,199,200],{},"  Load users\n",[85,202,204],{"class":87,"line":203},16,[85,205,206],{},"\u003C\u002Fbutton>\n",[85,208,210],{"class":87,"line":209},17,[85,211,129],{"emptyLinePlaceholder":128},[85,213,215],{"class":87,"line":214},18,[85,216,217],{},"{#if $error}\n",[85,219,221],{"class":87,"line":220},19,[85,222,223],{},"  \u003Cp>Unable to load users\u003C\u002Fp>\n",[85,225,227],{"class":87,"line":226},20,[85,228,229],{},"{\u002Fif}\n",[85,231,233],{"class":87,"line":232},21,[85,234,129],{"emptyLinePlaceholder":128},[85,236,238],{"class":87,"line":237},22,[85,239,240],{},"{#each $data as user}\n",[85,242,244],{"class":87,"line":243},23,[85,245,246],{},"  \u003Cp>{user}\u003C\u002Fp>\n",[85,248,250],{"class":87,"line":249},24,[85,251,252],{},"{\u002Feach}\n",[71,254,255,258,259,262,263,266],{},[82,256,257],{},"data",", ",[82,260,261],{},"error",", and ",[82,264,265],{},"loading"," are readable stores. Active work is invalidated when the component is destroyed.",[101,268,270],{"id":269},"fetch-on-mount","Fetch on mount",[75,272,276],{"className":273,"code":274,"language":275,"meta":80,"style":80},"language-ts shiki shiki-themes github-light github-dark github-dark","const users = useFetch(\n  (signal) => fetch(\"\u002Fapi\u002Fusers\", { signal }).then((response) => response.json()),\n  { initial: () => [] },\n);\n","ts",[82,277,278,298,347,363],{"__ignoreMap":80},[85,279,280,284,288,291,294],{"class":87,"line":88},[85,281,283],{"class":282},"so5gQ","const",[85,285,287],{"class":286},"suiK_"," users",[85,289,290],{"class":282}," =",[85,292,293],{"class":91}," useFetch",[85,295,297],{"class":296},"slsVL","(\n",[85,299,300,303,307,310,313,316,319,322,325,328,331,334,336,338,341,344],{"class":87,"line":119},[85,301,302],{"class":296},"  (",[85,304,306],{"class":305},"sQHwn","signal",[85,308,309],{"class":296},") ",[85,311,312],{"class":282},"=>",[85,314,315],{"class":91}," fetch",[85,317,318],{"class":296},"(",[85,320,321],{"class":95},"\"\u002Fapi\u002Fusers\"",[85,323,324],{"class":296},", { signal }).",[85,326,327],{"class":91},"then",[85,329,330],{"class":296},"((",[85,332,333],{"class":305},"response",[85,335,309],{"class":296},[85,337,312],{"class":282},[85,339,340],{"class":296}," response.",[85,342,343],{"class":91},"json",[85,345,346],{"class":296},"()),\n",[85,348,349,352,355,358,360],{"class":87,"line":125},[85,350,351],{"class":296},"  { ",[85,353,354],{"class":91},"initial",[85,356,357],{"class":296},": () ",[85,359,312],{"class":282},[85,361,362],{"class":296}," [] },\n",[85,364,365],{"class":87,"line":132},[85,366,367],{"class":296},");\n",[71,369,370,373,374,377,378,381],{},[82,371,372],{},"useFetch"," starts when the component mounts and exposes ",[82,375,376],{},"fetch()"," and ",[82,379,380],{},"abort()"," for later control.",[383,384,385],"style",{},"html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}",{"title":80,"searchDepth":119,"depth":119,"links":387},[388,389],{"id":103,"depth":119,"text":104},{"id":269,"depth":119,"text":270},"md",{},{},{"title":44,"description":80},"JrUFsYs2dw-peVdpXap41ESTfTO1QVSmcprR_X-MqaI",[396,397],{"title":40,"path":41,"stem":42,"description":80,"children":-1},{"title":48,"path":49,"stem":50,"description":80,"children":-1},1786006625961]