> For the complete documentation index, see [llms.txt](https://vytautaspranskunas.gitbook.io/react-state-rxjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vytautaspranskunas.gitbook.io/react-state-rxjs/core-concepts/actions/imutablejs.md).

# ImutableJs

Data STrategy

{% code title="todos.actions.ts" %}

```typescript
import { List } from 'immutable';
import { Store, HasStore, InjectStore } from "react-state-rxjs";
import { TodoModel } from "./todo.model";

@InjectStore('todos')
export class TodosStateActions extends HasStore<List<any>> {

    addTodo(item: TodoModel) {
        this.store.update(state => {
            state.push(Immutable.fromJS(item));
        })
    }

    deleteTodo(index: number) {
        this.store.update(state => {
            state.delete(index);
        }, false);
    }

    get todosAsync(): List<Map<any, any>> {
        return this.store.map((state) => {
            return state.toArray();
        }) as any;
    } // async way

    /// OR

    get todos() {
      return this.state.toArray();
    } // sync way
}
```

{% endcode %}
