-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation-guideline.html
More file actions
243 lines (241 loc) · 112 KB
/
documentation-guideline.html
File metadata and controls
243 lines (241 loc) · 112 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>LogosDX Documentation Guidelines | Logos DX</title>
<meta name="description" content="Focused TypeScript utilities for building JS apps in any runtime">
<meta name="generator" content="VitePress v2.0.0-alpha.16">
<link rel="preload stylesheet" href="/assets/style.puAb6RVC.css" as="style">
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
<script type="module" src="/assets/app.BagC3YiI.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/framework.EbgPHoH_.js">
<link rel="modulepreload" href="/assets/chunks/theme.BhAQupbP.js">
<link rel="modulepreload" href="/assets/documentation-guideline.md.ifcmtftV.lean.js">
<link rel="icon" href="/images/app-icon-red.png">
<link rel="icon" href="/images/app-icon-white.png" media="(prefers-color-scheme: dark)">
<meta property="og:title" content="Logos DX">
<meta property="og:description" content="Focused TypeScript utilities for building JS apps in any runtime">
<meta property="og:image" content="https://logosdx.dev/images/screenshot-site.png">
<meta property="og:url" content="https://logosdx.dev">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Logos DX">
<meta name="twitter:description" content="Focused TypeScript utilities for building JS apps in any runtime">
<meta name="twitter:image" content="https://logosdx.dev/images/screenshot-site.png">
<link rel="mask-icon" href="/images/app-icon-red.png" color="#ffffff">
<link rel="apple-touch-icon" href="/images/app-icon-red.png" sizes="180x180">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-H547DPM1VY"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-H547DPM1VY");</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.0.0/css/fontawesome.min.css">
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.0.0/js/all.min.js"></script>
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-f534aa51><!--[--><!--]--><!--[--><span tabindex="-1" data-v-640e4194></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-640e4194>Skip to content</a><!--]--><!----><header class="VPNav" data-v-f534aa51 data-v-6bbcf939><div class="VPNavBar has-sidebar top" data-v-6bbcf939 data-v-7bf307cf><div class="wrapper" data-v-7bf307cf><div class="container" data-v-7bf307cf><div class="title" data-v-7bf307cf><div class="VPNavBarTitle has-sidebar" data-v-7bf307cf data-v-4f7b1d18><a class="title" href="/" data-v-4f7b1d18><!--[--><!--]--><!--[--><img class="VPImage logo" src="/images/app-icon-red.png" alt data-v-056bc521><!--]--><span data-v-4f7b1d18>Logos DX</span><!--[--><!--]--></a></div></div><div class="content" data-v-7bf307cf><div class="content-body" data-v-7bf307cf><!--[--><!--]--><div class="VPNavBarSearch search" data-v-7bf307cf data-v-bff53c42><!--[--><button type="button" class="VPNavBarSearchButton" aria-label="Search" aria-keyshortcuts="/ control+k meta+k" data-v-bff53c42 data-v-2484d85f><span class="vpi-search" aria-hidden="true" data-v-2484d85f></span><span class="text" data-v-2484d85f>Search</span><span class="keys" aria-hidden="true" data-v-2484d85f><kbd class="key-cmd" data-v-2484d85f>⌘</kbd><kbd class="key-ctrl" data-v-2484d85f>Ctrl</kbd><kbd data-v-2484d85f>K</kbd></span></button><!----><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-7bf307cf data-v-961a7814><span id="main-nav-aria-label" class="visually-hidden" data-v-961a7814> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-961a7814 data-v-2320b7bd><!--[--><span data-v-2320b7bd>Home</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://typedoc.logosdx.dev" target="_blank" rel="noreferrer" tabindex="0" data-v-961a7814 data-v-2320b7bd><!--[--><span data-v-2320b7bd>TypeDocs</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/llms.txt" tabindex="0" data-v-961a7814 data-v-2320b7bd><!--[--><span data-v-2320b7bd>llms.txt</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-7bf307cf data-v-45c9087c><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-45c9087c data-v-ef09584f data-v-e40da30e><span class="check" data-v-e40da30e><span class="icon" data-v-e40da30e><!--[--><span class="vpi-sun sun" data-v-ef09584f></span><span class="vpi-moon moon" data-v-ef09584f></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-7bf307cf data-v-69de79bc data-v-31c6b9fb><!--[--><a class="VPSocialLink no-icon" href="https://github.com/logosdx/monorepo" aria-label="github" target="_blank" rel="me noopener" data-v-31c6b9fb data-v-6c2b535d><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-7bf307cf data-v-b9c7a6a4 data-v-5efd9d41><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-5efd9d41><span class="vpi-more-horizontal icon" data-v-5efd9d41></span></button><div class="menu" data-v-5efd9d41><div class="VPMenu" data-v-5efd9d41 data-v-5c38526d><!----><!--[--><!--[--><!----><div class="group" data-v-b9c7a6a4><div class="item appearance" data-v-b9c7a6a4><p class="label" data-v-b9c7a6a4>Appearance</p><div class="appearance-action" data-v-b9c7a6a4><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-b9c7a6a4 data-v-ef09584f data-v-e40da30e><span class="check" data-v-e40da30e><span class="icon" data-v-e40da30e><!--[--><span class="vpi-sun sun" data-v-ef09584f></span><span class="vpi-moon moon" data-v-ef09584f></span><!--]--></span></span></button></div></div></div><div class="group" data-v-b9c7a6a4><div class="item social-links" data-v-b9c7a6a4><div class="VPSocialLinks social-links-list" data-v-b9c7a6a4 data-v-31c6b9fb><!--[--><a class="VPSocialLink no-icon" href="https://github.com/logosdx/monorepo" aria-label="github" target="_blank" rel="me noopener" data-v-31c6b9fb data-v-6c2b535d><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-7bf307cf data-v-35e09ed1><span class="container" data-v-35e09ed1><span class="top" data-v-35e09ed1></span><span class="middle" data-v-35e09ed1></span><span class="bottom" data-v-35e09ed1></span></span></button></div></div></div></div><div class="divider" data-v-7bf307cf><div class="divider-line" data-v-7bf307cf></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-f534aa51 data-v-fc6cb30b><div class="container" data-v-fc6cb30b><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-fc6cb30b><span class="vpi-align-left menu-icon" data-v-fc6cb30b></span><span class="menu-text" data-v-fc6cb30b>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-fc6cb30b data-v-b3864467><button data-v-b3864467>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-f534aa51 data-v-dec53b96><div class="curtain" data-v-dec53b96></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-dec53b96><span class="visually-hidden" id="sidebar-aria-label" data-v-dec53b96> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-2fe2f2c8><section class="VPSidebarItem level-0" data-v-2fe2f2c8 data-v-3052c330><div class="item" role="button" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><h2 class="text" data-v-3052c330>Introduction</h2><!----></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-1 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/getting-started.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Getting Started</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/what-is-logosdx.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>What is LogosDX?</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-2fe2f2c8><section class="VPSidebarItem level-0" data-v-2fe2f2c8 data-v-3052c330><div class="item" role="button" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><h2 class="text" data-v-3052c330>Packages</h2><!----></div><div class="items" data-v-3052c330><!--[--><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Observer</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/events.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Events</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/generators.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Generators</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/queues.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Queues</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/relay.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Relay</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/observer/advanced.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Advanced</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Utils</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/error-handling.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Error Handling</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/flow-control.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Flow Control</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/data.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Data Operations</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/performance.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Performance & Caching</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/utils/validation.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Validation & Type Guards</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Fetch</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/configuration.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Configuration</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/requests.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Making Requests</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/hooks.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Hooks</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/plugins.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Plugins</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/resilience.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Resilience</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/policies.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Policies</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/events.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Events</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/fetch/advanced.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Advanced</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/state-machine/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>State Machine</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/state-machine/api.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>API Reference</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/state-machine/guide.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Practical Guide</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Dom</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/selection.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Selection</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/styling.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Styling</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/aria.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Aria</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/events.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Events</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/templates.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Templates</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/animate.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Animate</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/dom/observers.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Observers</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/storage/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Storage</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/storage/api.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>API Reference</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/storage/drivers.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Drivers</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/storage/events.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Events</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-3052c330 data-v-3052c330><div class="item" tabindex="0" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/" data-v-3052c330><!--[--><h3 class="text" data-v-3052c330>Localize</h3><!--]--></a><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3052c330><span class="vpi-chevron-right caret-icon" data-v-3052c330></span></div></div><div class="items" data-v-3052c330><!--[--><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/translations.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Translations</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/pluralization.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Pluralization</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/intl.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Intl Formatting</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/async-loading.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Async Loading</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/namespaces.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Namespaces</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/events.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Events</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/type-extractor.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Type Extractor</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/localize/api.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>API Reference</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/hooks.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>Hooks</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3052c330 data-v-3052c330><div class="item" data-v-3052c330><div class="indicator" data-v-3052c330></div><a class="VPLink link link" href="/packages/react.html" data-v-3052c330><!--[--><p class="text" data-v-3052c330>React</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-f534aa51 data-v-f832591b><div class="VPDoc has-sidebar has-aside" data-v-f832591b data-v-d420190f><!--[--><!--]--><div class="container" data-v-d420190f><div class="aside" data-v-d420190f><div class="aside-curtain" data-v-d420190f></div><div class="aside-container" data-v-d420190f><div class="aside-content" data-v-d420190f><div class="VPDocAside" data-v-d420190f data-v-810bb596><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-810bb596 data-v-afd0f391><div class="content" data-v-afd0f391><div class="outline-marker" data-v-afd0f391></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-afd0f391>On this page</div><ul class="VPDocOutlineItem root" data-v-afd0f391 data-v-c49c31c8><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-810bb596></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-d420190f><div class="content-container" data-v-d420190f><!--[--><!--]--><main class="main" data-v-d420190f><div style="position:relative;" class="vp-doc _documentation-guideline" data-v-d420190f><div><h1 id="logosdx-documentation-guidelines" tabindex="-1">LogosDX Documentation Guidelines <a class="header-anchor" href="#logosdx-documentation-guidelines" aria-label="Permalink to “LogosDX Documentation Guidelines”"></a></h1><h2 id="purpose" tabindex="-1">Purpose <a class="header-anchor" href="#purpose" aria-label="Permalink to “Purpose”"></a></h2><p>These guidelines help create documentation that transfers understanding, not just information. Great docs enable developers (human and AI) to truly comprehend your library - its purpose, design, and usage - not just parrot its syntax.</p><h2 id="core-principles" tabindex="-1">Core Principles <a class="header-anchor" href="#core-principles" aria-label="Permalink to “Core Principles”"></a></h2><h3 id="_1-invisible-structure" tabindex="-1">1. Invisible Structure <a class="header-anchor" href="#_1-invisible-structure" aria-label="Permalink to “1. Invisible Structure”"></a></h3><p>Users shouldn't notice the documentation framework - they should simply find what they need. Structure serves content, not the other way around.</p><p><strong>Good</strong>: Natural sections that emerge from the material <strong>Bad</strong>: Meta-documentation noise ("This section covers...", "Following the three-pillar framework...")</p><h3 id="_2-natural-voice" tabindex="-1">2. Natural Voice <a class="header-anchor" href="#_2-natural-voice" aria-label="Permalink to “2. Natural Voice”"></a></h3><p>Write in your own voice, demonstrating expertise and judgment. Avoid formulaic or robotic language.</p><p><strong>Good</strong>: "We chose error tuples over try-catch because deeply nested error handling becomes hard to follow and debug" <strong>Bad</strong>: "This document provides comprehensive documentation for error handling following established patterns"</p><h3 id="_3-expert-perspective" tabindex="-1">3. Expert Perspective <a class="header-anchor" href="#_3-expert-perspective" aria-label="Permalink to “3. Expert Perspective”"></a></h3><p>Show deep understanding through:</p><ul><li>Honest discussion of tradeoffs</li><li>Clear reasoning about design decisions</li><li>Anticipation of questions and confusion</li><li>Analogies that illuminate concepts</li></ul><h3 id="_4-concise-examples" tabindex="-1">4. Concise Examples <a class="header-anchor" href="#_4-concise-examples" aria-label="Permalink to “4. Concise Examples”"></a></h3><p>Examples should be minimal but complete. Show what matters, omit what doesn't.</p><p><strong>Good</strong>: 3 examples (basic + realistic + edge case) in ~50 lines <strong>Bad</strong>: 10 progressive examples covering every option combination in 500 lines</p><h2 id="what-documentation-must-cover" tabindex="-1">What Documentation Must Cover <a class="header-anchor" href="#what-documentation-must-cover" aria-label="Permalink to “What Documentation Must Cover”"></a></h2><p>Every package should answer three questions:</p><h3 id="_1-what-can-i-do-with-this" tabindex="-1">1. What can I do with this? <a class="header-anchor" href="#_1-what-can-i-do-with-this" aria-label="Permalink to “1. What can I do with this?”"></a></h3><p><strong>API Surface Coverage:</strong></p><ul><li>Function signatures with complete type information</li><li>All parameters (required and optional) with defaults</li><li>Return types and possible values</li><li>Error types and conditions</li><li>Configuration schemas</li><li>Interface definitions</li></ul><p><strong>Standards:</strong></p><ul><li>Zero ambiguity</li><li>Exhaustive coverage</li><li>TypeScript syntax</li><li>Precise, factual</li></ul><h3 id="_2-why-is-it-designed-this-way" tabindex="-1">2. Why is it designed this way? <a class="header-anchor" href="#_2-why-is-it-designed-this-way" aria-label="Permalink to “2. Why is it designed this way?”"></a></h3><p><strong>Design & Philosophy Coverage:</strong></p><ul><li>What problem does this solve? Why should I care?</li><li>How does it work? What's the mechanism?</li><li>How is it structured? What's the architecture?</li><li>What primitives/concepts does it build on?</li><li>What was traded off for what gain?</li><li>Why not approach X instead?</li><li>How should I think about this?</li></ul><p><strong>Standards:</strong></p><ul><li>Start with the problem and why it matters</li><li>Explain reasoning, not just decisions</li><li>Be honest about limitations</li><li>Provide judgment frameworks ("use X when Y")</li><li>Let structure emerge naturally from content</li></ul><h3 id="_3-how-do-i-use-it-in-practice" tabindex="-1">3. How do I use it in practice? <a class="header-anchor" href="#_3-how-do-i-use-it-in-practice" aria-label="Permalink to “3. How do I use it in practice?”"></a></h3><p><strong>Pattern & Usage Coverage:</strong></p><ul><li>Basic usage (happy path)</li><li>Realistic usage (with error handling, real context)</li><li>Edge cases (non-obvious scenarios)</li><li>Integration patterns (composing with other tools)</li><li>Common mistakes and anti-patterns</li></ul><p><strong>Standards:</strong></p><ul><li>Complete, runnable code</li><li>Real scenarios, not toy examples</li><li>Show imports, types, context</li><li>Demonstrate best practices</li><li><strong>Keep it concise</strong> - 3 examples typically sufficient</li></ul><h2 id="file-organization" tabindex="-1">File Organization <a class="header-anchor" href="#file-organization" aria-label="Permalink to “File Organization”"></a></h2><h3 id="main-package-document-structure" tabindex="-1">Main Package Document Structure <a class="header-anchor" href="#main-package-document-structure" aria-label="Permalink to “Main Package Document Structure”"></a></h3><p>Every package's main documentation file must include:</p><ol><li><p><strong>Overview</strong> (1 paragraph)</p><ul><li>What this package is (formal cause)</li><li>What problem it solves and why it matters (telos/final cause)</li><li>How it achieves this, if it fits naturally (efficient cause)</li></ul></li><li><p><strong>Getting Started</strong> (Facts + Patterns combined)</p><ul><li>The shortest possible introduction to usage</li><li>1-3 high-impact examples that highlight strengths</li><li>Points to full API reference for details</li></ul></li><li><p><strong>Core Concepts</strong> (Philosophy condensed)</p><ul><li>Essential mental models and design decisions</li><li>Key tradeoffs and when to use</li><li>Points to full philosophy doc (if separate)</li></ul></li></ol><h3 id="default-structure" tabindex="-1">Default Structure <a class="header-anchor" href="#default-structure" aria-label="Permalink to “Default Structure”"></a></h3><p>Most packages use a single documentation file:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>docs/packages/</span></span>
<span class="line"><span>└── packagename.md</span></span>
<span class="line"><span> ├── Overview (1 paragraph)</span></span>
<span class="line"><span> ├── Getting Started (quick examples)</span></span>
<span class="line"><span> ├── Core Concepts (condensed philosophy)</span></span>
<span class="line"><span> ├── API Reference (exhaustive)</span></span>
<span class="line"><span> ├── Design (if needed)</span></span>
<span class="line"><span> └── Usage Patterns (concise examples)</span></span></code></pre></div><h3 id="when-to-split-into-separate-files" tabindex="-1">When to Split into Separate Files <a class="header-anchor" href="#when-to-split-into-separate-files" aria-label="Permalink to “When to Split into Separate Files”"></a></h3><p>Extract into separate files when content deserves deep, focused discussion:</p><p><strong>Indicators for separate <code>philosophy.md</code>:</strong></p><ul><li>Multiple significant design decisions with tradeoffs</li><li>Non-obvious architectural choices requiring explanation</li><li>Competing approaches that were considered and rejected</li><li>Complex mental models essential for understanding</li></ul><p><strong>Examples needing separate philosophy docs:</strong></p><ul><li><code>utils</code> - Error tuple rationale, inflight deduplication reasoning, stale-while-revalidate design</li><li><code>observer</code> - Event propagation models, memory management tradeoffs, pub/sub patterns</li><li><code>state-machine</code> - State transition semantics, determinism guarantees</li></ul><p><strong>Examples not needing separate philosophy docs:</strong></p><ul><li><code>fetch</code> - Straightforward HTTP client wrapper</li><li><code>storage</code> - Simple persistence abstraction</li><li><code>localize</code> - Standard i18n implementation</li></ul><p><strong>When to extract <code>patterns.md</code>:</strong></p><ul><li>Large collection of usage recipes</li><li>Complex integration scenarios</li><li>Many edge cases worth demonstrating</li></ul><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>docs/packages/</span></span>
<span class="line"><span>├── utils/</span></span>
<span class="line"><span>│ ├── api.md</span></span>
<span class="line"><span>│ ├── philosophy.md</span></span>
<span class="line"><span>│ └── patterns.md</span></span>
<span class="line"><span>└── fetch.md (simple packages can stay single-file)</span></span></code></pre></div><h3 id="file-naming" tabindex="-1">File Naming <a class="header-anchor" href="#file-naming" aria-label="Permalink to “File Naming”"></a></h3><ul><li><code>{package}.md</code> - Single-file documentation (simpler packages)</li><li><code>{package}/api.md</code> - API reference (when split)</li><li><code>{package}/philosophy.md</code> - Design and concepts (when split)</li><li><code>{package}/patterns.md</code> - Usage patterns (when split)</li></ul><h2 id="writing-guidelines-by-type" tabindex="-1">Writing Guidelines by Type <a class="header-anchor" href="#writing-guidelines-by-type" aria-label="Permalink to “Writing Guidelines by Type”"></a></h2><h3 id="api-reference-facts" tabindex="-1">API Reference (Facts) <a class="header-anchor" href="#api-reference-facts" aria-label="Permalink to “API Reference (Facts)”"></a></h3><p><strong>Purpose</strong>: Provide precise, unambiguous facts about your API.</p><p><strong>Structure:</strong></p><ul><li>Function name as heading</li><li>Brief paragraph explaining purpose, effect, and motivation to use (telos)</li><li>Function signatures with complete types</li><li>Parameters with types, defaults, constraints</li><li>Return types and possible values</li><li>Error types and when they occur</li><li>Complete configuration schemas</li></ul><p><strong>Example - Good:</strong></p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">## </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Caches </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> results</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> with</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> configurable</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> TTL</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> and</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> LRU</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> eviction</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">preventing</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> duplicate</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> concurrent</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> requests</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">thundering</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> herd</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">). </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Returns</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> stale</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> data</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> while</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetching</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fresh</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> in</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> the</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> background</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> for</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> faster</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> response</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> times</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">. </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Use</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> this</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> when</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> you</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> need</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> to</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cache</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> expensive</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> I</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">O</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> operations</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">API</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> calls</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">database</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> queries</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">while</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> maintaining</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> reasonable</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> freshness</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> guarantees</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> AsyncFunc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>(</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> fn</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> opts</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MemoizeOptions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> EnhancedMemoizedFunction</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">interface</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MemoizeOptions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">> {</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> ttl</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Default: 60000 (must be > 0)</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> maxSize</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Default: 1000 (must be > 0)</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> staleIn</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Default: undefined (must be >= 0, < ttl)</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> staleTimeout</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Default: undefined (>= 0)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> generateKey</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Parameters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onError</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">error</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Parameters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> EnhancedMemoizedFunction</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">> </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> T</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> cache</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> clear</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> void</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> delete</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">key</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> boolean</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> has</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">key</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> boolean</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> size</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> stats</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> CacheStats</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><strong>Example - Bad:</strong></p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Memoizes a function with caching options</span></span></code></pre></div><p><strong>Standards:</strong></p><ul><li>Document every public API</li><li>Include all optional parameters with defaults</li><li>Specify constraints (must be > 0, etc.)</li><li>List all possible return values and errors</li><li>Use TypeScript syntax even in prose</li></ul><h3 id="philosophy-design-concepts" tabindex="-1">Philosophy (Design & Concepts) <a class="header-anchor" href="#philosophy-design-concepts" aria-label="Permalink to “Philosophy (Design & Concepts)”"></a></h3><p><strong>Purpose</strong>: Teach the underlying reasoning, mental models, and decision-making.</p><p><strong>Natural Structure</strong> (emerges from content):</p><ul><li>Problem statement</li><li>How it works (mechanism)</li><li>Architecture and structure</li><li>Primitives and foundations</li><li>Tradeoffs and alternatives</li><li>When to use / not use</li><li>Performance characteristics</li><li>Common misconceptions</li></ul><p><strong>Example - Good:</strong></p><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Why Error Tuples?</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### The Problem</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Try-catch blocks create deeply nested code that becomes hard to follow. When you have multiple async operations, each requiring different error handling, you end up with nested try-catch blocks or one giant catch that treats all errors the same.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">```typescript</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Deeply nested and hard to follow</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetchUser</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(id);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> orders</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetchOrders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(user.id);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> processOrders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(orders);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (processErr) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Which operation failed? How to handle specifically?</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (ordersErr) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Different handling for orders failure</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">} </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (userErr) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Different handling for user failure</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>Additionally, try-catch makes it easy to accidentally ignore errors - a missing catch means silent failure.</p><h3 id="the-solution" tabindex="-1">The Solution <a class="header-anchor" href="#the-solution" aria-label="Permalink to “The Solution”"></a></h3><p><code>attempt()</code> and <code>attemptSync()</code> wrap try-catch blocks and return <code>[result, error]</code> tuples. On success: <code>[value, null]</code>. On failure: <code>[null, Error]</code>. This makes error handling explicit at each step while avoiding nesting.</p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">userErr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> attempt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetchUser</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(id));</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (userErr) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleUserError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(userErr);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">orders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">ordersErr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> attempt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetchOrders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(user.id));</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (ordersErr) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleOrdersError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(ordersErr);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> processOrders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(orders);</span></span></code></pre></div><p>The flat structure makes it obvious what can fail and where. Error handling is right there, not buried in a distant catch block.</p><h3 id="implementation" tabindex="-1">Implementation <a class="header-anchor" href="#implementation" aria-label="Permalink to “Implementation”"></a></h3><p><code>attempt()</code> is just a try-catch wrapper that returns tuples:</p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">} </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (e) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, e </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">as</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>This lets you ignore errors when they don't matter (just don't check the second value) while encouraging explicit error handling for every async call.</p><h3 id="when-to-use" tabindex="-1">When to Use <a class="header-anchor" href="#when-to-use" aria-label="Permalink to “When to Use”"></a></h3><p><strong>Use error tuples for:</strong></p><ul><li>I/O operations (network, filesystem, database)</li><li>Operations with external failure modes</li><li>Code requiring granular error handling per operation</li></ul><p><strong>Use try-catch for:</strong></p><ul><li>Top-level error boundaries</li><li>Catching programming errors you can't predict</li><li>Never for business logic control flow</li></ul><h3 id="performance" tabindex="-1">Performance <a class="header-anchor" href="#performance" aria-label="Permalink to “Performance”"></a></h3><p>No meaningful overhead - just an array allocation. The try-catch is still there internally, so no performance difference from hand-written try-catch.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span></span></span>
<span class="line"><span>**Example - Bad:**</span></span>
<span class="line"><span></span></span>
<span class="line"><span>```markdown</span></span>
<span class="line"><span>## Error Tuples</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Error tuples return `[result, error]` instead of throwing. This is useful for error handling.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>Use `attempt()` for async functions and `attemptSync()` for sync functions.</span></span></code></pre></div><p><strong>Standards:</strong></p><ul><li>Start with why this exists and why I should care</li><li>Explain how it actually works (mechanism, not just API)</li><li>Show what it's built on (primitives)</li><li>Discuss structure and architecture</li><li>Compare alternatives honestly</li><li>Provide decision frameworks</li><li>Include performance characteristics</li><li>Anticipate and address confusion</li><li><strong>Let section headers emerge naturally</strong> - no formulaic labels</li></ul><h3 id="patterns-usage-examples" tabindex="-1">Patterns (Usage Examples) <a class="header-anchor" href="#patterns-usage-examples" aria-label="Permalink to “Patterns (Usage Examples)”"></a></h3><p><strong>Purpose</strong>: Demonstrate practical usage through concise, runnable code.</p><p><strong>Structure:</strong></p><p>Each function/feature should have <strong>at most</strong> 3 examples:</p><ol><li><strong>Basic</strong> - Happy path, minimal but complete</li><li><strong>Realistic</strong> - Real-world usage with error handling</li><li><strong>Edge Case</strong> - Non-obvious scenario (if applicable)</li></ol><p><strong>Example - Good (Concise):</strong></p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { memoize, attempt } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@logosdx/utils'</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Basic: Cache expensive API calls</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> getUser</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(fetchUser, { ttl: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> user1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getUser</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'42'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Fetches</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> user2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getUser</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'42'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Cached</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Realistic: With error handling and stale-while-revalidate</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> getPrice</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(fetchPrice, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ttl: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> staleIn: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Stale after 30s</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> staleTimeout: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Wait max 1s for fresh</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">price</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">err</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> attempt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getPrice</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'AAPL'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (err) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> handleError</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(err)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Edge case: Custom key for complex arguments</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> getData</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(fetchResource, {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> generateKey</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">opts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> `${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">opts</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">userId</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}:${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">opts</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">type</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}`</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ userId: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'42'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'profile'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, metadata: {</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">} })</span></span></code></pre></div><p><strong>Example - Bad (Verbose):</strong></p><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 1: Basic usage</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 2: With TTL</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { ttl: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 3: With maxSize</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn3</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { maxSize: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 4: With both</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn4</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { ttl: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, maxSize: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 5: With custom key</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn5</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { generateKey: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 6: With error handler</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn6</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { onError: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Example 7: With stale-while-revalidate</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> fn7</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> memoize</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { staleIn: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// ... (10 more variations)</span></span></code></pre></div><p><strong>Standards:</strong></p><ul><li><strong>Minimal but complete</strong> - 3 examples maximum per feature</li><li>Show imports and types</li><li>Demonstrate realistic scenarios</li><li>Include error handling in realistic examples</li><li>Use actual variable names, not placeholders</li><li>Comment sparingly (code should speak)</li><li>No progressive complexity ladders</li><li>No exhaustive option combinations</li></ul><h2 id="llm-helper-documentation" tabindex="-1">LLM Helper Documentation <a class="header-anchor" href="#llm-helper-documentation" aria-label="Permalink to “LLM Helper Documentation”"></a></h2><h3 id="purpose-1" tabindex="-1">Purpose <a class="header-anchor" href="#purpose-1" aria-label="Permalink to “Purpose”"></a></h3><p>The <code>skill/references/{package}.md</code> files serve a different purpose: providing optimized context for AI assistants to understand and use your library correctly.</p><h3 id="structure" tabindex="-1">Structure <a class="header-anchor" href="#structure" aria-label="Permalink to “Structure”"></a></h3><p>Use <strong>explicit section headers</strong>:</p><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;"># @logosdx/package-name</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Brief one-sentence description.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Facts (API)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[Concise but complete API reference]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Philosophy</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[Condensed design reasoning and mental models]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Patterns</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[Essential usage examples]</span></span></code></pre></div><h3 id="characteristics" tabindex="-1">Characteristics <a class="header-anchor" href="#characteristics" aria-label="Permalink to “Characteristics”"></a></h3><p><strong>Different from user docs:</strong></p><ul><li><strong>More robotic</strong> - Optimized for RAG systems</li><li><strong>More structured</strong> - Explicit labels for context retrieval</li><li><strong>More condensed</strong> - Shorter explanations, more information density</li><li><strong>Manually curated</strong> - Not auto-generated</li></ul><p><strong>Example:</strong></p><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Facts (API)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">function memoize<T>(fn: T, opts?: MemoizeOptions<T>): EnhancedMemoizedFunction<T></span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Built-in inflight deduplication</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> LRU eviction at maxSize</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> TTL-based expiration</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Stale-while-revalidate support</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Pluggable cache adapters</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Options: ttl (60000), maxSize (1000), staleIn (undefined), staleTimeout (undefined), generateKey, onError, adapter</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Philosophy</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Solves thundering herd (duplicate concurrent requests) + caching. Uses error tuples internally. Async only (use memoizeSync for sync functions). LRU eviction uses access sequence for deterministic ordering.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">When to use: API calls, database queries, expensive computations with reproducible results.</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">When not to use: Non-deterministic functions, side effects, sync functions.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Patterns</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Basic with error handling</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">const getUser = memoize(fetchUser, { ttl: 60000 })</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">const [user, err] = await attempt(() => getUser('42'))</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Stale-while-revalidate for speed</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">const getPrice = memoize(fetchPrice, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ttl: 60000, staleIn: 30000, staleTimeout: 1000</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Custom key for hot paths</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">const getData = memoize(fetch, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> generateKey: ([</span><span style="--shiki-light:#032F62;--shiki-light-text-decoration:underline;--shiki-dark:#DBEDFF;--shiki-dark-text-decoration:underline;">opts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]) => opts.userId</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span></span></code></pre></div><h2 id="quality-checklist" tabindex="-1">Quality Checklist <a class="header-anchor" href="#quality-checklist" aria-label="Permalink to “Quality Checklist”"></a></h2><h3 id="main-document-structure" tabindex="-1">Main Document Structure <a class="header-anchor" href="#main-document-structure" aria-label="Permalink to “Main Document Structure”"></a></h3><ul><li>[ ] Overview paragraph covers what, why, and (if natural) how</li><li>[ ] Getting Started has 1-3 high-impact examples</li><li>[ ] Getting Started points to full API reference</li><li>[ ] Core Concepts condenses key philosophy</li><li>[ ] Core Concepts points to full philosophy doc (if separate)</li></ul><h3 id="api-reference" tabindex="-1">API Reference <a class="header-anchor" href="#api-reference" aria-label="Permalink to “API Reference”"></a></h3><ul><li>[ ] Every function has heading with its name</li><li>[ ] Every function has telos paragraph (purpose, effect, motivation)</li><li>[ ] Every public API documented</li><li>[ ] All parameters with types, defaults, constraints</li><li>[ ] Return types explicit</li><li>[ ] Error types documented</li><li>[ ] Configuration schemas complete</li><li>[ ] No ambiguous language</li></ul><h3 id="philosophy" tabindex="-1">Philosophy <a class="header-anchor" href="#philosophy" aria-label="Permalink to “Philosophy”"></a></h3><ul><li>[ ] Problem statement clear</li><li>[ ] Mechanism explained</li><li>[ ] Structure described</li><li>[ ] Foundations identified</li><li>[ ] Tradeoffs discussed honestly</li><li>[ ] Decision frameworks provided ("when to use")</li><li>[ ] Performance characteristics noted</li><li>[ ] Common mistakes warned against</li><li>[ ] Alternatives compared</li><li>[ ] Section headers emerge naturally from content</li></ul><h3 id="patterns" tabindex="-1">Patterns <a class="header-anchor" href="#patterns" aria-label="Permalink to “Patterns”"></a></h3><ul><li>[ ] Examples are runnable</li><li>[ ] Common use cases covered</li><li>[ ] <strong>Maximum 3 examples per feature</strong></li><li>[ ] Error handling shown in realistic examples</li><li>[ ] Edge cases demonstrated (if non-obvious)</li><li>[ ] Integration patterns included (if applicable)</li><li>[ ] Best practices modeled</li><li>[ ] Code is concise</li></ul><h2 id="common-mistakes" tabindex="-1">Common Mistakes <a class="header-anchor" href="#common-mistakes" aria-label="Permalink to “Common Mistakes”"></a></h2><h3 id="❌-meta-documentation-noise" tabindex="-1">❌ Meta-Documentation Noise <a class="header-anchor" href="#❌-meta-documentation-noise" aria-label="Permalink to “❌ Meta-Documentation Noise”"></a></h3><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This document provides comprehensive documentation for memoization</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">following the three-pillar framework (Memory, Reasoning, Examples).</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Memory: The "What"</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">This section covers the complete API reference...</span></span></code></pre></div><p><strong>Problem</strong>: Framework labels visible to users. Self-referential noise.</p><p><strong>Fix</strong>: Just write the content naturally.</p><h3 id="❌-robotic-template-following" tabindex="-1">❌ Robotic Template Following <a class="header-anchor" href="#❌-robotic-template-following" aria-label="Permalink to “❌ Robotic Template Following”"></a></h3><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Function: retry()</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Purpose</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Retries a function.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Parameters</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> fn: Function to retry</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> options: Retry options</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Returns</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Promise</span></span></code></pre></div><p><strong>Problem</strong>: Tells WHAT but not WHY or WHEN. No judgment or expertise.</p><p><strong>Fix</strong>: Explain the problem, reasoning, and decision framework.</p><h3 id="❌-excessive-example-variations" tabindex="-1">❌ Excessive Example Variations <a class="header-anchor" href="#❌-excessive-example-variations" aria-label="Permalink to “❌ Excessive Example Variations”"></a></h3><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Example 1: Basic</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">retry(fn, { retries: 3 })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Example 2: With delay</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">retry(fn, { retries: 3, delay: 1000 })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Example 3: With backoff</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">retry(fn, { retries: 3, delay: 1000, backoff: 2 })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// Example 4: With jitter</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">retry(fn, { retries: 3, delay: 1000, backoff: 2, jitter: 0.1 })</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">// ... (20 more variations)</span></span></code></pre></div><p><strong>Problem</strong>: Verbosity without insight. Every option combination shown.</p><p><strong>Fix</strong>: Show 3 examples: basic, realistic with error handling, edge case.</p><h3 id="❌-examples-without-context" tabindex="-1">❌ Examples Without Context <a class="header-anchor" href="#❌-examples-without-context" aria-label="Permalink to “❌ Examples Without Context”"></a></h3><div class="language-typescript"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">retry</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(fn, { retries: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span></code></pre></div><p><strong>Problem</strong>: Where does <code>fn</code> come from? What types? How to handle errors?</p><p><strong>Fix</strong>: Show complete, runnable code with imports, types, error handling.</p><h3 id="❌-philosophy-without-tradeoffs" tabindex="-1">❌ Philosophy Without Tradeoffs <a class="header-anchor" href="#❌-philosophy-without-tradeoffs" aria-label="Permalink to “❌ Philosophy Without Tradeoffs”"></a></h3><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Error tuples are better than try-catch because they make errors explicit.</span></span></code></pre></div><p><strong>Problem</strong>: One-sided view. No discussion of costs or alternatives.</p><p><strong>Fix</strong>: Honest comparison showing when each approach is appropriate.</p><h3 id="❌-formulaic-section-headers" tabindex="-1">❌ Formulaic Section Headers <a class="header-anchor" href="#❌-formulaic-section-headers" aria-label="Permalink to “❌ Formulaic Section Headers”"></a></h3><div class="language-markdown"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Design Philosophy</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Final Cause (Why It Exists)</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Efficient Cause (How It Works)</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Formal Cause (Structure)</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Material Cause (Primitives)</span></span></code></pre></div><p><strong>Problem</strong>: Framework concepts leaked into user-facing documentation.</p><p><strong>Fix</strong>: Natural headers that emerge from content (e.g., "The Problem", "How It Works", "When to Use").</p><h2 id="testing-your-documentation" tabindex="-1">Testing Your Documentation <a class="header-anchor" href="#testing-your-documentation" aria-label="Permalink to “Testing Your Documentation”"></a></h2><h3 id="the-human-test" tabindex="-1">The Human Test <a class="header-anchor" href="#the-human-test" aria-label="Permalink to “The Human Test”"></a></h3><p>Can a developer who has never seen your library:</p><ol><li>Understand what problem it solves? (Philosophy)</li><li>Find the exact API they need? (API Reference)</li><li>Get working code in <5 minutes? (Patterns)</li></ol><h3 id="the-ai-test" tabindex="-1">The AI Test <a class="header-anchor" href="#the-ai-test" aria-label="Permalink to “The AI Test”"></a></h3><p>Ask an AI assistant (Claude, GPT, etc.) to:</p><ol><li>Explain when to use feature X vs feature Y</li><li>Write code solving a realistic problem</li><li>Debug an issue or anti-pattern</li></ol><p>If the AI struggles with judgment or reasoning, your philosophy docs need work. If the AI makes syntax errors, your API reference needs work. If the AI can't produce working examples, your patterns need work.</p><h2 id="summary" tabindex="-1">Summary <a class="header-anchor" href="#summary" aria-label="Permalink to “Summary”"></a></h2><p>Great documentation requires answering three questions with the right balance:</p><table tabindex="0"><thead><tr><th>What to Cover</th><th>Purpose</th><th>Standard</th></tr></thead><tbody><tr><td><strong>What can I do?</strong></td><td>API surface, capabilities</td><td>Exhaustive, precise, typed</td></tr><tr><td><strong>Why is it this way?</strong></td><td>Design decisions, tradeoffs</td><td>Honest, reasoned, insightful</td></tr><tr><td><strong>How do I use it?</strong></td><td>Practical patterns</td><td>Concise, complete, realistic</td></tr></tbody></table><p><strong>Remember</strong>: Information without wisdom is just noise. Teach judgment and understanding, not just syntax.</p><h2 id="invisible-philosophical-framework" tabindex="-1">Invisible Philosophical Framework <a class="header-anchor" href="#invisible-philosophical-framework" aria-label="Permalink to “Invisible Philosophical Framework”"></a></h2><p>These Aristotelian concepts guide philosophy sections (but remain invisible to readers):</p><p><strong>Four Causes</strong> (hierarchical order for presenting ideas):</p><ol><li>Final - Why does this exist? What problem does it solve?</li><li>Efficient - How does it work? What's the mechanism?</li><li>Formal - How is it structured? What's the architecture?</li><li>Material - What is it built from? What primitives?</li></ol><p><strong>Additional Concepts</strong> (thinking tools for writers):</p><ul><li><strong>Potentiality ↔ Actuality</strong>: How does this library actualize potentials? What transformations does it enable?</li><li><strong>Hylomorphism</strong>: What is the "matter" (data, state) and "form" (structure, logic) of this system?</li><li><strong>Laws of Thought</strong>: Identity, Non-Contradiction, Excluded Middle guide clear reasoning</li><li><strong>Law of Sufficient Reason</strong>: Provide complete explanations, avoid "just because" answers</li></ul><p>These are thinking tools for writers, not section headers or labels for readers. Let the structure emerge naturally from the content while being guided by these principles.</p></div></div></main><footer class="VPDocFooter" data-v-d420190f data-v-d452acd4><!--[--><!--]--><div class="edit-info" data-v-d452acd4><div class="edit-link" data-v-d452acd4><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/logosdx/monorepo/edit/master/docs/documentation-guideline.md" target="_blank" rel="noreferrer" data-v-d452acd4><!--[--><span class="vpi-square-pen edit-link-icon" data-v-d452acd4></span> Edit this page on GitHub<!--]--></a></div><!----></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-d452acd4><span class="visually-hidden" id="doc-footer-aria-label" data-v-d452acd4>Pager</span><div class="pager" data-v-d452acd4><!----></div><div class="pager" data-v-d452acd4><a class="VPLink link pager-link next" href="/getting-started.html" data-v-d452acd4><!--[--><span class="desc" data-v-d452acd4>Next page</span><span class="title" data-v-d452acd4>Getting Started</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-f534aa51 data-v-456dda6d><div class="container" data-v-456dda6d><p class="message" data-v-456dda6d><a href="https://github.com/logosdx/monorepo/blob/master/LICENSE">BSD-3-Clause License</a> · <a href="/llms.txt">llms.txt</a> · <a href="/llms-full.txt">llms-full.txt</a></p><p class="copyright" data-v-456dda6d>Copyright © 2023+ Logos DX</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"claude.md\":\"CjIDHs0q\",\"documentation-guideline.md\":\"ifcmtftV\",\"getting-started.md\":\"DzJxXbSl\",\"index.md\":\"DWeqBy5a\",\"packages_dom_animate.md\":\"lTmfVFzJ\",\"packages_dom_aria.md\":\"C8a_LO23\",\"packages_dom_events.md\":\"Dl3fjxIe\",\"packages_dom_index.md\":\"CNEFwZBA\",\"packages_dom_observers.md\":\"Clum79ti\",\"packages_dom_selection.md\":\"CIsNIIDt\",\"packages_dom_styling.md\":\"DfXvk4UW\",\"packages_dom_templates.md\":\"CEgoDaes\",\"packages_fetch_advanced.md\":\"CfdY902H\",\"packages_fetch_configuration.md\":\"B-5Anq_6\",\"packages_fetch_events.md\":\"CVXadEbf\",\"packages_fetch_hooks.md\":\"D8zj_WI8\",\"packages_fetch_index.md\":\"vVMMu5Ku\",\"packages_fetch_plugins.md\":\"CQbiH9oN\",\"packages_fetch_policies.md\":\"Bk4czXmB\",\"packages_fetch_requests.md\":\"CcZnXkrl\",\"packages_fetch_resilience.md\":\"CwaqMzDI\",\"packages_hooks.md\":\"B_2qXT9w\",\"packages_localize_api.md\":\"jIwJfxcl\",\"packages_localize_async-loading.md\":\"B2eAZQPz\",\"packages_localize_events.md\":\"DY1c31B-\",\"packages_localize_index.md\":\"CrukTK5E\",\"packages_localize_intl.md\":\"B7eVuxwI\",\"packages_localize_namespaces.md\":\"DcAaWlm5\",\"packages_localize_pluralization.md\":\"FGGQ6hdB\",\"packages_localize_translations.md\":\"CKo3PX6t\",\"packages_localize_type-extractor.md\":\"BWJflOMT\",\"packages_observer_advanced.md\":\"B_zrlYVy\",\"packages_observer_events.md\":\"DUynfm7E\",\"packages_observer_generators.md\":\"Cs2B2A4-\",\"packages_observer_index.md\":\"CYvxvIdM\",\"packages_observer_queues.md\":\"JQqEGC35\",\"packages_observer_relay.md\":\"H2Mx9v4R\",\"packages_react.md\":\"DsFjMbv8\",\"packages_state-machine_api.md\":\"CtO-u-Mw\",\"packages_state-machine_guide.md\":\"B36f4bPP\",\"packages_state-machine_index.md\":\"Cj0Xiohb\",\"packages_storage_api.md\":\"DqWgsmqk\",\"packages_storage_drivers.md\":\"VUN_WMqs\",\"packages_storage_events.md\":\"CgcnDoT-\",\"packages_storage_index.md\":\"1V6zHxzH\",\"packages_utils_data.md\":\"BNZbGnm2\",\"packages_utils_error-handling.md\":\"-3iW_1qi\",\"packages_utils_flow-control.md\":\"Crcmtyou\",\"packages_utils_index.md\":\"Ci-_1QBB\",\"packages_utils_performance.md\":\"BpH27xOs\",\"packages_utils_validation.md\":\"DidDm0at\",\"plans_2026-03-03-api-hooks-design.md\":\"DEX6BgCC\",\"plans_2026-03-03-api-hooks-plan.md\":\"DfNWKBmT\",\"public_llm_dom.md\":\"BpuiIhJ0\",\"public_llm_fetch.md\":\"eqI81TIF\",\"public_llm_hooks.md\":\"DNqmoxPv\",\"public_llm_localize.md\":\"DMg-6aMH\",\"public_llm_observer.md\":\"D-WZdkVf\",\"public_llm_react.md\":\"C527nQzT\",\"public_llm_state-machine.md\":\"DX5IKr2X\",\"public_llm_storage.md\":\"UUkc0gU8\",\"public_llm_utils.md\":\"Dfa2o70v\",\"what-is-logosdx.md\":\"FSgUrAvP\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Logos DX\",\"description\":\"Focused TypeScript utilities for building JS apps in any runtime\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"/images/app-icon-red.png\",\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/logosdx/monorepo\"}],\"nav\":[{\"text\":\"Home\",\"link\":\"/\"},{\"text\":\"TypeDocs\",\"link\":\"https://typedoc.logosdx.dev\"},{\"text\":\"llms.txt\",\"link\":\"/llms.txt\"}],\"sidebar\":[{\"text\":\"Introduction\",\"items\":[{\"text\":\"Getting Started\",\"link\":\"/getting-started\"},{\"text\":\"What is LogosDX?\",\"link\":\"/what-is-logosdx\"}]},{\"text\":\"Packages\",\"items\":[{\"text\":\"Observer\",\"link\":\"/packages/observer/\",\"collapsed\":true,\"items\":[{\"text\":\"Events\",\"link\":\"/packages/observer/events\"},{\"text\":\"Generators\",\"link\":\"/packages/observer/generators\"},{\"text\":\"Queues\",\"link\":\"/packages/observer/queues\"},{\"text\":\"Relay\",\"link\":\"/packages/observer/relay\"},{\"text\":\"Advanced\",\"link\":\"/packages/observer/advanced\"}]},{\"text\":\"Utils\",\"link\":\"/packages/utils/\",\"collapsed\":true,\"items\":[{\"text\":\"Error Handling\",\"link\":\"/packages/utils/error-handling\"},{\"text\":\"Flow Control\",\"link\":\"/packages/utils/flow-control\"},{\"text\":\"Data Operations\",\"link\":\"/packages/utils/data\"},{\"text\":\"Performance & Caching\",\"link\":\"/packages/utils/performance\"},{\"text\":\"Validation & Type Guards\",\"link\":\"/packages/utils/validation\"}]},{\"text\":\"Fetch\",\"link\":\"/packages/fetch/\",\"collapsed\":true,\"items\":[{\"text\":\"Configuration\",\"link\":\"/packages/fetch/configuration\"},{\"text\":\"Making Requests\",\"link\":\"/packages/fetch/requests\"},{\"text\":\"Hooks\",\"link\":\"/packages/fetch/hooks\"},{\"text\":\"Plugins\",\"link\":\"/packages/fetch/plugins\"},{\"text\":\"Resilience\",\"link\":\"/packages/fetch/resilience\"},{\"text\":\"Policies\",\"link\":\"/packages/fetch/policies\"},{\"text\":\"Events\",\"link\":\"/packages/fetch/events\"},{\"text\":\"Advanced\",\"link\":\"/packages/fetch/advanced\"}]},{\"text\":\"State Machine\",\"link\":\"/packages/state-machine/\",\"collapsed\":true,\"items\":[{\"text\":\"API Reference\",\"link\":\"/packages/state-machine/api\"},{\"text\":\"Practical Guide\",\"link\":\"/packages/state-machine/guide\"}]},{\"text\":\"Dom\",\"link\":\"/packages/dom/\",\"collapsed\":true,\"items\":[{\"text\":\"Selection\",\"link\":\"/packages/dom/selection\"},{\"text\":\"Styling\",\"link\":\"/packages/dom/styling\"},{\"text\":\"Aria\",\"link\":\"/packages/dom/aria\"},{\"text\":\"Events\",\"link\":\"/packages/dom/events\"},{\"text\":\"Templates\",\"link\":\"/packages/dom/templates\"},{\"text\":\"Animate\",\"link\":\"/packages/dom/animate\"},{\"text\":\"Observers\",\"link\":\"/packages/dom/observers\"}]},{\"text\":\"Storage\",\"link\":\"/packages/storage/\",\"collapsed\":true,\"items\":[{\"text\":\"API Reference\",\"link\":\"/packages/storage/api\"},{\"text\":\"Drivers\",\"link\":\"/packages/storage/drivers\"},{\"text\":\"Events\",\"link\":\"/packages/storage/events\"}]},{\"text\":\"Localize\",\"link\":\"/packages/localize/\",\"collapsed\":true,\"items\":[{\"text\":\"Translations\",\"link\":\"/packages/localize/translations\"},{\"text\":\"Pluralization\",\"link\":\"/packages/localize/pluralization\"},{\"text\":\"Intl Formatting\",\"link\":\"/packages/localize/intl\"},{\"text\":\"Async Loading\",\"link\":\"/packages/localize/async-loading\"},{\"text\":\"Namespaces\",\"link\":\"/packages/localize/namespaces\"},{\"text\":\"Events\",\"link\":\"/packages/localize/events\"},{\"text\":\"Type Extractor\",\"link\":\"/packages/localize/type-extractor\"},{\"text\":\"API Reference\",\"link\":\"/packages/localize/api\"}]},{\"text\":\"Hooks\",\"link\":\"/packages/hooks\"},{\"text\":\"React\",\"link\":\"/packages/react\"}]}],\"editLink\":{\"pattern\":\"https://github.com/logosdx/monorepo/edit/master/docs/:path\",\"text\":\"Edit this page on GitHub\"},\"search\":{\"provider\":\"local\"},\"footer\":{\"message\":\"<a href=\\\"https://github.com/logosdx/monorepo/blob/master/LICENSE\\\">BSD-3-Clause License</a> · <a href=\\\"/llms.txt\\\">llms.txt</a> · <a href=\\\"/llms-full.txt\\\">llms-full.txt</a>\",\"copyright\":\"Copyright © 2023+ Logos DX\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false,\"additionalConfig\":{}}");</script>
</body>
</html>