How to use the resolve-es.default function in resolve-es

To help you get started, we’ve selected a few resolve-es examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davidnussio / moleculer-cqrs / src / cqrs-event-sourcing.js View on Github external
this.storage = createEsStorage({ databaseFile: ":memory:" });
      } else {
        this.storage = this.schema.storage;
      }

      if (this.schema.aggregateName) {
        this.aggregateName = this.schema.aggregateName;
      } else {
        this.aggregateName = this.name;
      }

      const publishEvent = ctx => event => {
        ctx.broker.broadcast(event.type, event);
      };

      this.eventStore = createEventStore({
        storage: this.storage,
        publishEvent: publishEvent(this),
      });

      if (this.settings.aggregate) {
        this.aggregate = this.settings.aggregate;
        delete this.settings.aggregate;
        this.commandHandler = commandHandler({
          eventStore: this.eventStore,
          aggregates: [this.aggregate],
          // snapshotAdapter
        });
        this.metadata.aggregate = true;
        this.metadata.commands = Object.keys(this.aggregate.commands).map(
          name => name
        );
github reimagined / resolve / tests / read-models-transactional / worker.js View on Github external
case 'mongo':
        adapter = createMongoDBAdapter({
          url: process.env.MONGO_URL
        })
        break
      default:
        throw new Error(
          `Incorrect process.env.ADAPTER = ${process.env.ADAPTER}`
        )
    }

    const storage = createStorage({
      pathToFile: path.join(__dirname, 'event-storage.db')
    })

    const eventStore = createEventStore({ storage })
    const connectorName = 'default-adapter'
    const readModelName = 'default-read-model'

    const query = createQuery({
      eventStore,
      viewModels: [],
      readModelConnectors: {
        [connectorName]: adapter
      },
      readModels: [
        {
          name: readModelName,
          connectorName,
          projection,
          resolvers
        }

resolve-es

The reSolve framework's event store.

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular resolve-es functions