> For the complete documentation index, see [llms.txt](https://creatorlabs.gitbook.io/boltui-docs-preview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://creatorlabs.gitbook.io/boltui-docs-preview/api-reference/index/state.md).

# State

### Definition

```javascript
function State(initial: any) {
    return {
        update: function,
        get: function,
        onUpdate: function
    }
}
```

### Input

Takes `initial` of any type

### Returns an object

* `update(value: any)` : updates the current state with the input value
* `get()` : returns the current state
* `onUpdate(value: function)` : takes a callback function and calls the function whenever the state is updated
