This is part of the [ES-Git](https://github.com/es-git/es-git) project.


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @es-git/cache-objects-mixin in KB



This is part of the ES-Git project.


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


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)

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


The repo is the same as the object-mixin repo, but the constructor takes one parameter, 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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.