0.10.0 • Published 3 years ago

@es-git/cache-objects-mixin v0.10.0

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

cache-objects-mixin

This is part of the ES-Git project.

Install

npm install --save @es-git/cache-objects-mixin

Usage

Mix this in with the IObjectRepo. By storing objects in a cache, loading and saving the same object multiple times will be faster.

import cacheObjectsMixin from '@es-git/cache-objects-mixin';
import objectsMixin from '@es-git/objects-mixin';
import MemoryRepo from '@es-git/memory-repo';

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

const repo = new Repo({
  max: 1000,
  maxAge: 1000*60*5
});

Interfaces

The repo is the same as the object-mixin repo, but the constructor takes one parameter, options:

Options

interface Options {
  max? : number,
  maxAge? : number
};
  • max is the number of objects to store in the cache
  • maxAge is the duration, in milliseconds, to store the objects in the cache
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.2

7 years ago

0.0.1

7 years ago