@n7e/data-memory
v0.2.0
Published
In-memory implementations of the @n7e/model data mapper and repository strategy.
Downloads
5
Readme
Data Memory
In-memory implementations of the @n7e/model data mapper and repository strategy.
Both the data mapper and repository strategy share the same data model, so they can share entities:
import { MemoryDataMapper } from "@n7e/data-memory/data-mappers";
import { MemoryStrategy } from "@n7e/data-memory/repositories";
const entities = new Map();
const dataMapper = new MemoryDataMapper(entities);
const strategy = new MemoryStrategy(entities);
// Any entities created by the data mapper will be retrievable by the repository
// strategy.