> 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/async.md).

# Async

`@react-state/store` has native support of observables and promises like RxJs. In order to make action async add `@Async()` decorator on top of th function

Functions or getters should return observable or promise.

#### Example taken from sample application

```typescript
 @Async()
 get progress(): any {
        return this.store.select(['checkbox'])
            .pipe(
                switchMap(state => iif(() => !!state,
                    interval(20).pipe(
                        takeUntil(timer(4000).pipe(
                            tap(_ => {
                                this.store.update(state => {
                                    state.set('disabled', false);
                                });
                            }))
                        )),
                    of(0)
                ))
            )
    }
```

![](https://1022882979-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauZLLqXJJcAhFbBISq%2F-LcUuCLhZiIEystSAQGM%2F-LcV-wnbKgyFTIBp2xb4%2Freactasyncsupport.gif?alt=media\&token=588692d1-75ea-4a45-8612-e56924d154b9)
