Skip to content

Commit

Permalink
Update 99_labs.md
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Apr 22, 2024
1 parent 1e5bf8c commit ddbf570
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions docs/04_examples/99_labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ title: Labs

[Learn more about Labs](https://github.com/FartLabs/labs).

```tsx
```ts
import { Lab } from "labs/labs.ts";

export interface Note {
interface Note {
title?: string;
content: string;
}

export const notesLab = new Lab()
.variable("notes", new Map())
const notesLab = new Lab()
.variable("notes", new Map<string, Note>())
.procedure(
"notes.add",
(note: Note, { notes }) => {
Expand All @@ -40,8 +40,15 @@ export const notesLab = new Lab()
["notes"],
);

notesLab.execute("notes.add", { title: "Hello", content: "World" });
notesLab.execute(
"notes.add",
{ title: "Hello", content: "World" },
);

const notes = notesLab.execute(
"notes.list",
{},
);

const notes = notesLab.execute("notes.list", {});
console.log(notes);
```

0 comments on commit ddbf570

Please sign in to comment.