LogoLogo
v3.2
v3.2
  • Introduction
  • Getting Started
    • Why
    • Installation
  • Concepts
    • Introduction
    • Store
    • Actions
    • State
    • Select
  • API
    • Action
    • Actions
    • ActionsStream
    • Module
    • of-action
    • Select
    • Selector
    • State
    • Store
  • Advanced
    • Lazy Loading
    • Sub States
    • Cancellation
    • Action Handlers
    • Composition
    • Error Handling
    • Life-cycle
    • Meta Reducers
    • Shared State
  • Recipes
    • Authentication
    • Caching
    • Unit Testing
    • Style Guide
  • Plugins
    • Introduction
    • Logger
    • Devtools
    • Storage
    • Forms
    • Web Socket
    • Router
  • Community
    • FAQ
    • Resources
    • Contributors
    • Contributing
    • Sponsors
  • Changelog
Powered by GitBook
On this page
  1. Advanced

Composition

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

@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.

PreviousAction HandlersNextError Handling

Last updated 6 years ago