# Store

## What is store?

The **Store** is holds the state, and is responsible for change of state. You can also subscribe to a store for changes.

## Creating a store

{% code title="stores/todo.js" %}

```javascript
import reim from 'reim'

const todoStore = reim({
    todos: []
})

export default todoStore
```

{% endcode %}

### Creating a named store

A store is anonymous by default. You can create a named store for use with plugins e.g. **reim-reporter.**

```javascript
const todoStore = reim({
    todos: []
}, {
    name: 'Todo-Store'
})
```

### Adding plugins

You can easily apply plugins on store

```javascript
import react from 'react-reim'

const store = reim({message: ''}, {
    plugins: [react()]
})
```

or after it is initialized

```javascript
const store = reim({}).plugin(persist())
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://reimjs.gitbook.io/reim/guide/store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
