# Getting & modifying the app state

Source: https://developers.inkdrop.app/guides/flux-architecture

Inkdrop uses [Redux](https://redux.js.org/), an implementation of Facebook's [Flux Application Architecture](https://facebook.github.io/flux/) to coordinate the movement of data through the application.

Flux is extremely well suited for applications that support third-party extension because it emphasizes loose coupling and well defined interfaces between components.
It enforces:

- Uni-directional data flow
- Loose coupling between components

For more information about the Flux pattern, check out [this diagram](https://facebook.github.io/flux/docs/overview.html#structure-and-data-flow).

You can access the app state via `env.store.getState()` on the [Environment](https://developers.inkdrop.app/modules/environment) passed to `activate(env)`.

## Actions

You can dispatch the internal actions like so:

```js
import { actions } from 'inkdrop'

env.store.dispatch(actions.books.update())
```

See [a list of available actions](https://developers.inkdrop.app/actions) in reference.

## States

To get the current app state, for example, you can get [editingNote](https://developers.inkdrop.app/states/editing-note) like so:

```js
const { editingNote } = env.store.getState()
```

Or, to connect this state with your React component:

```js
import { useSelector } from 'react-redux'

const selector = ({ editingNote }) => editingNote

const MyComponent = props => {
  const editingNote = useSelector(selector)
  // render
}
```

See [a list of available states](https://developers.inkdrop.app/states) in reference.
