eskit v2.1.1
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
- Jonathan Windridge - Project lead - Trium Capital
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
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago