0.10.0 • Published 3 years ago

@es-git/read-combiner-mixin v0.10.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

read-combiner-mixin

This is part of the ES-Git project.

Install

npm install --save @es-git/read-combiner-mixin

Usage

Mix this in with an IObjectRepo.

This is a performance enhancing mixin. If reads for the same object are made at the same time, this mixin wil ensure that only one read is made to the repo.

import objectsMixin from '@es-git/objects-mixin';
import readCombinerMixin from '@es-git/read-combiner-mixin';
import MemoryRepo from '@es-git/memory-repo';

const Repo = mix(MemoryRepo)
            .with(objectsMixin)
            .with(readCombinerMixin);

const repo = new Repo();
const [object1, object2, object3] = await Promise.all([
  repo.loadObject(hash),
  repo.loadObject(hash),
  repo.loadObject(hash)
]);

Interfaces

This mixin does not enhance the repo in any observable way, it only wraps the loadObject methody

0.10.0

3 years ago

0.9.0

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.0

6 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.1

7 years ago