Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Apr 25, 2024
1 parent 5f8e845 commit 86e4c64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sites/docs/content/functions/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ flat.increment();
console.log(flat.count); // 2
```

### `box.readonly`

Creates a readonly box from a writable box that remains in sync with the original box.

```ts
const count = box(1)
const readonlyCount = box.readonly(count)
console.log(readonlyCount.value) // 1
count.value++
console.log(readonlyCount.value) // 2

readonlyCount.value = 3 // Error: Cannot assign to read only property 'value' of object
```

### `box.isBox`

Checks if a value is a `Box`.
Expand Down

0 comments on commit 86e4c64

Please sign in to comment.