Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfla1 committed Jul 4, 2024
1 parent 0c2a42f commit e4b1bca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ const res = run(() => {

ok('yes')
})
```

// or async
Or async

```ts
const res = await run(async () => {
unwrap(await doStuff())

Expand Down Expand Up @@ -198,9 +200,11 @@ function fn() {
const boxedFn = box(fn)

const res = boxedFn()
```

// or with arguments
Or with arguments

```ts
async function fn(what: string) {
ok(`yes, ${what}`)
})
Expand All @@ -210,7 +214,7 @@ const boxedFn = box(fn)
const res = await boxedFn('sir')
```

### `safe`
### `safeBox`

Utility to wrap a function reference inside a safe context. Same rules as [`safe`](#safe) apply.

Expand Down

0 comments on commit e4b1bca

Please sign in to comment.