> For the complete documentation index, see [llms.txt](https://docs.conanjs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.conanjs.io/data/flows/testing-flows.md).

# Observing Flows

## Introduction

As described on the [serialising flows](/data/flows/flows-as-state.md), you should be able to serialise a Flow to a ConanState that suits you, and then leverage all the features of the [Conan State](/data/conan-state.md) to observe it.

We have though some mechanisms to provide you with a shortcut when observing flows

{% hint style="danger" %}
As of v1.0 we only have hooks, but we are planning to add more shortcuts to observe directly flows without having to serialise them
{% endhint %}

## Hooks

### useFlow

```typescript
useFlow<AuthenticationState,AuthenticationFlow>(
        authentication$F, 
        setState, 
        (status, previousState) => ({
                ...previousState,
                current: status.name,
        })
);
```

This hook receives&#x20;

* a flow
* the method to set the state for this component
* a function that returns the new state and that takes
  * the status information that has just been updated
  * the previous state

### useFlowStatus

```typescript
useFlowStatus<AuthenticationState, AuthenticationFlow,"authenticating">(
        authentication$F, 
        "authenticating", 
        setState, 
        (status, previousState) => ({
                ...previousState,
                currentUser: status[0]
         }
 ));
```

This hook receives&#x20;

* a flow
* the name of the status to subscribe to
* the method to set the state for this component
* a function that returns the new state and that takes
  * the state information that has just been updated
  * the previous state

{% hint style="info" %}
To see an example of hooks, check our demo [Authentication](/tutorials/conan-flow-demos/authentication.md)
{% endhint %}
