Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
/ core Public archive

EQuateJS Core API Library - A loose implementation of CQRS/ES for managing application state.

License

Notifications You must be signed in to change notification settings

eq8/core

Repository files navigation

@eq8/core

David Travis codecov

EQuateJS Core API Library - A loose interface for CQRS/ES

NOTE: The package eq8-core can be found in the legacy branch.

Overview

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.

Contents

Installation

npm install --save @eq8/core

Events

Basically, @eq8/core is an EventEmitter object and has the following events:

Event: 'dispatch'

Emitted when Core#dispatch gets called

Event: 'subscribe'

Emitted when Core#subscribe gets called

Constructor

var core = require('@eq8/core')(options);

Parameters

  • options is an optional object with the following attributes:
    • logger by default is winston object

Methods

Core#dispatch(e, done)

Emits a dispatch event and passes the parameters e and done to the event handler

Parameters

  • e is an arbitrary object to represent a command event

Core#subscribe(q, done)

Emits a subscribe event and passes the parameters q and done to the event handler

Parameters

  • q is an arbitrary object to represent a query event
  • done is an arbitrary callback function but conventionally takes an error-first argument: var done = function(err, ...){ ...}

Appendices

  • [Contributing] (./CONTRIBUTING.md)
  • [License] (./LICENSE)

About

EQuateJS Core API Library - A loose implementation of CQRS/ES for managing application state.

Resources

License

Stars

Watchers

Forks

Packages

No packages published