ryan-mars / stochastic

TypeScript framework for building event-driven services. Easily go from Event Storming → Code.
MIT License
6 stars 1 forks source link

feat: add event handler and read model L1 and refactor infrastructure.ts #47

Closed sam-goodwin closed 3 years ago

sam-goodwin commented 3 years ago

This change adds two new low-level (L1) constructs:

  1. Dependency - a simple expression of a dependency on a string value at runtime that must be configured at infrastructure synth time.
  2. EventHandler - a simple construct to trigger a handler in response to some events in the bounded context.

This EventHandler construct can act as an escape hatch or (later) as a building block for higher level constructs such as ReadModel. For now (in this change), our basic ReadModel construct is functionally identical to an EventHandler, but we will look at building more layers of abstraction for read models in a follow up PR.

House keeping:

  1. refactored tsconfig.json to use project references for faster builds and for immediate propagation of changes to types while developing.
  2. refactored the monolithic infrastructure.ts into separate files. More to do later.