Skip to content

Commit b12cc74

Browse files
authored
doc: integrate typed selector pattern (#92)
1 parent d4ee840 commit b12cc74

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/guides/using-sel-references.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,21 @@ customNets.CUSTOMNET2 // "net.CUSTOMNET2"
226226
// customNets.DOES_NOT_EXIST // TypeScript error!
227227
```
228228

229+
### Collecting Typed Nets
230+
231+
You may want to group your typed nets alongside other reusable selectors:
232+
233+
```tsx
234+
import { sel } from "tscircuit"
235+
236+
const selectors = {
237+
net: sel.net<"GND" | "VCC" | "V5">(),
238+
// ...other selectors
239+
}
240+
241+
selectors.net.GND // "net.GND"
242+
```
243+
229244
### Dynamic Reference Designators
230245

231246
You can call `sel` as a function to create selectors for any reference designator.

0 commit comments

Comments
 (0)