1.25.3 • Published 2 years ago

@castore/inmemory-event-storage-adapter v1.25.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

In Memory Event Storage Adapter

DRY Castore EventStorageAdapter implementation using a JS object.

This class is mainly useful for manual and unit tests. It is obviously not recommended for production uses 🙂

📥 Installation

# npm
npm install @castore/inmemory-event-storage-adapter

# yarn
yarn add @castore/inmemory-event-storage-adapter

This package has @castore/core as peer dependency, so you will have to install it as well:

# npm
npm install @castore/core

# yarn
yarn add @castore/core

👩‍💻 Usage

import { InMemoryStorageAdapter } from '@castore/inmemory-event-storage-adapter';

const pokemonsEventsStorageAdapter = new InMemoryStorageAdapter({
  // 👇 You can specify an initial state for your event store
  initialEvents: [
    {
      aggregateId: '123',
      ...
    },
  ],
});

const pokemonsEventStore = new EventStore({
  ...
  storageAdapter: pokemonsEventsStorageAdapter,
});

🤔 How it works

This adapter simply persists events in a local dictionary. You can retrieve it at all time through the eventStore property:

const eventStore = pokemonsEventStore.eventStore;
// => { [aggregateId: string]: EventDetail[] }
1.21.0

2 years ago

1.25.0

2 years ago

1.25.1

2 years ago

1.23.0

2 years ago

1.25.2

2 years ago

1.25.3

2 years ago

1.22.0

2 years ago

1.24.1

2 years ago

1.24.2

2 years ago

1.22.1

2 years ago

1.24.0

2 years ago

1.22.2

2 years ago

1.20.1

2 years ago

1.20.2

2 years ago

1.20.0

2 years ago

1.19.0

2 years ago

1.18.1

2 years ago

1.17.2

2 years ago

1.18.0

2 years ago

1.17.1

2 years ago

1.19.1

2 years ago

1.15.0

2 years ago

1.14.0

2 years ago

1.13.0

2 years ago

1.17.0

2 years ago

1.16.1

2 years ago

1.15.2

2 years ago

1.16.0

2 years ago

1.15.1

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.10.0

2 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.4.4

3 years ago

1.7.0

3 years ago

1.4.3

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.3

3 years ago