# Operators

Store has multiple operators:

* **Select** - select peace of the state by provided path. Returns new observable. `this.store.selecte(['todos'])`
* **Initialize** - initialize store with with new state. Returns observable holding initialized state. `this.store.initialize(['todos', 'filter'], {newItem: false, usedItem: true})`
* **Clear** - resets whole state to initial state. `this.store.clear()`
* **Reset** - resets selected peace of state to its initial state: `this.store.select(['todos']).reset()`&#x20;
* **Map** - transforms and returns state value.
* **Update** - updates selected state.&#x20;

```typescript
this.store.update((state: Map<any, any>) => {
        // For ImmutableJs
        state.set('itemToStore', 'changed value');
        // For immer
        state.itemToStore = 'changed value'
});
```

According to immutableJS there is second parameter that can be passed to update function `wrapToWithMutations` It is used when you want to do multiple updates before triggering mutation. <https://stackoverflow.com/questions/28510753/when-should-i-use-withmutations-on-a-map-in-immutable-js>


---

# 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://vytautaspranskunas.gitbook.io/react-state-rxjs/core-concepts/store/operators.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.
