hebo

    7.1.0 • Public • Published

    hebo

    build status code coverage code style styled with prettier made with lass license

    Simple CQRS / Event Sourcing Container

    Table of Contents

    Install

    npm:

    npm install hebo

    yarn:

    yarn add hebo

    Usage

    // Meant to be done at require time
    const Hebo = require('hebo');
    const libraryAggregate = require('./path/to/my/libraryAggregate');
    const bookAggregate = require('./path/to/my/bookAggregate');
    
    const hebo = new Hebo({
        aggregates: {
          library: libraryAggregate,
          book: bookAggregate,
        }
    })
    
    // ... and then do this at runtime:
    const { getProjection, runCommand, updateSnapshot } = hebo.connect({
        eventRepository,
        snapshotRepository,
        notificationHandler,
        authorizer,
        user,
    });
    
    await runCommand('createLibrary', 1234);
    await runCommand('setLibraryName', 1234, 'North Branch');
    
    const library = getProjection('library', 1234);
    
    await updateSnapshot('library', 1234);

    Contributors

    Name
    Steve Caldwell

    License

    MIT © Steve Caldwell

    Install

    npm i hebo

    DownloadsWeekly Downloads

    1

    Version

    7.1.0

    License

    MIT

    Unpacked Size

    33.6 kB

    Total Files

    16

    Last publish

    Collaborators

    • scaldwell77