# async-cache-promise [![Build Status](https://travis-ci.org/kesla/async-cache-promise.png?branch=master)](https://travis-ci.org/kesla/async-cache-promise)

async-cache - but with promises

## Installation

Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.

```sh
npm install async-cache-promise --save
```

## Usage

```js
import co from 'co';
import setupAsyncCache from 'async-cache-promise';

co(function * (t) {
  let count = 0;
  const cache = setupAsyncCache({
    load: key => {
      count++;
      return Promise.resolve(key);
    }
  });

  console.log('this is not cached', yield cache.get(123));
  console.log('this is cached', yield cache.get(123));
});

```

## Tests

```sh
npm install
npm test
```

## Dependencies

- [async-cache](https://github.com/isaacs/async-cache): Cache your async lookups and don&#39;t fetch the same thing more than necessary.
- [bluebird](https://github.com/petkaantonov/bluebird): Full featured Promises/A+ implementation with exceptionally good performance
- [immutable-object-methods](https://github.com/micnews/immutable-object-methods): Update normal plain javascript object, immutable style. Simlar to how immutable.js, seamless-immutable etc does it but a lot smaller and simpler.

## Dev Dependencies

- [babel-cli](https://github.com/babel/babel/tree/master/packages): Babel command line.
- [babel-core](https://github.com/babel/babel/tree/master/packages): Babel compiler core.
- [babel-preset-es2015](https://github.com/babel/babel/tree/master/packages): Babel preset for all es2015 plugins.
- [babel-tape-runner](https://github.com/wavded/babel-tape-runner): Babel + Tape for running your ES Next tests
- [semistandard](https://github.com/Flet/semistandard): All the goodness of `feross/standard` with semicolons sprinkled on top.
- [snazzy](https://github.com/feross/snazzy): Format JavaScript Standard Style as Stylish (i.e. snazzy) output
- [tapava](https://github.com/kesla/tapava): the syntax of ava, run through tape


## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_
