EQuateJS Core API Library - A loose interface for CQRS/ES
NOTE: The package eq8-core
can be found in the legacy
branch.
The core building blocks are:
- commands in the form of events for updating the application state; and,
- queries are used for returning the current state of the application.
npm install --save @eq8/core
Basically, @eq8/core
is an EventEmitter
object and has the following events:
Emitted when Core#dispatch
gets called
Emitted when Core#subscribe
gets called
var core = require('@eq8/core')(options);
options
is an optional object with the following attributes:logger
by default iswinston
object
Emits a dispatch
event and passes the parameters e
and done
to the event handler
e
is an arbitrary object to represent a command event
Emits a subscribe
event and passes the parameters q
and done
to the event handler
q
is an arbitrary object to represent a query eventdone
is an arbitrary callback function but conventionally takes an error-first argument:var done = function(err, ...){ ...}
- [Contributing] (./CONTRIBUTING.md)
- [License] (./LICENSE)