2.1.1 • Published 5 years ago

eskit v2.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

eskit - A framework for building Event Sourced / CQRS Applications

eskit (Pronounced 'ess-kit') is a library for building applications that make use of event sourcing.

Installation

npm install eskit

The project makes use of InversifyJS for managing dependency injection. This package requires reflection of metadata, and as such a call to require('reflect-metadata') must be made prior to importing eskit package components.

Running the tests

npm run test

Building the documentation

npm run doc

Usage

  • Defining an aggregate
import { createAggregateRoot, IAggregateRoot } from 'eskit';

interface ICounter {
  value: number;
}

const Counter = createAggregateRoot<ICounter>({
  commands: {
    incrementBy(entity, command) {
      const { by } = command.data;
      entity.publish('incremented', { by });
    }
  },
  initialState: {
    value: 0
  },
  name: 'counter',
  reducer: {
    incremented: (state, event) => ({
      ...state,
      value: state.value + event.data.by
    })
  }
});

Contributing

Please read CONTRIBUTING.md for details on the code of conduct & process for submitting pull requests.

Versioning

This repository uses SemVer for versioning. For the available versions, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgements

  • Typescript Starter: This project was bootstraped with the excellent Typescript Starter CLI tool.
  • Vaughn Vernon: Inspiration for this project and some of the design patterns it implements have been drawn from Vaughn's book "Implementing Domain Driven Design".
  • CQRSHotel: Inspiration for the API controller / Application Service pattern was drawn from the CQRSHotel project
2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago