> For the complete documentation index, see [llms.txt](https://www.ngxs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.ngxs.io/v3.3/advanced/composition.md).

# Composition

You can compose multiple stores together using class inheritance. This is quite simple:

```typescript
@State({
  name: 'zoo'
})
class ZooState {
  @Action(Eat)
  eat() {}
}

@State({
  name: 'stlzoo'
})
class StLouisZooState extends ZooState {
  @Action(Drink)
  drink() {}
}
```

Now when `StLouisZooState` is invoked, it will share the actions of the `ZooState`.
