Skip to content

Commit 11ef63d

Browse files
committed
docs: add usage section
1 parent 00042a3 commit 11ef63d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ Bun:
3434
bun add @kasnix/structured-objects
3535
```
3636

37+
## Usage
38+
39+
```typescript
40+
import { ObjectGraph } from "@kasnix/structured-objects/object-graph";
41+
42+
type DataItem = {
43+
id: string;
44+
// ...
45+
};
46+
47+
const dataList: Array<DataItem> = [/* ... */];
48+
49+
const dataGraph = new ObjectGraph<DataItem>(dataList, (dataItem) => dataItem.id);
50+
```
51+
3752
## Documentation
3853

3954
- [Object Graph](./docs/object-graph.doc.md)

0 commit comments

Comments
 (0)