Skip to content

$emitDomainEvent doesn't work like expected #3

@medialwerk

Description

@medialwerk

$emitDomainEvent returns a promise. It could lead to an error if you stack the $emitDomainEvent promises and if the handle functions are also working with promises. Because then the spec code, the app code and the eventric testing code are working with micro tasks and in this case you cannot say which code executes first. With this setup it could be, that the initializing of the projection can't find all created domain events.

tChartContext.$emitDomainEvent 'ItemCreated'
.then ->
  tChartContext.$emitDomainEvent 'ItemDeleted'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions