# vuex-strong-cache

> Allow stronger cache for Vuex getters

Latest version **0.1.1** (published 2017-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install vuex-strong-cache
pnpm add vuex-strong-cache
yarn add vuex-strong-cache
bun add vuex-strong-cache
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-05-17 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | katashin |
| Maintainers | ktsn |
| Keywords | Vue, Vuex, cache, getter, memoize |

## Links

- npm: https://www.npmjs.com/package/vuex-strong-cache
- Repository: https://github.com/ktsn/vuex-strong-cache
- Issues: https://github.com/ktsn/vuex-strong-cache/issues
- npm.io page: https://npm.io/package/vuex-strong-cache

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-05-17
- 0.1.0 — 2017-05-17

## README

# vuex-strong-cache

Allow stronger cache for Vuex getters.

## What is this?

This library allows you to cache the result of function that returned by a getter. In other words, even if you write like the following getter, the final result will be cached as same as a normal getter result.

```js
getters: {
  getTodoById: (state, getters) => (id) => {
    return state.todos.find(todo => todo.id === id)
  }
}
```

## Installation

```sh
$ npm install --save vuex-strong-cache
# or
$ yarn add vuex-strong-cache
```

## Usage

vuex-strong-cache provides a helper function that can enhance getters. You can just wrap your getters by the `enhancedGetters` helper so that all your getters will ready to have stronger caching.

```js
import { enhancedGetters } from 'vuex-strong-cache'

export default {
  state: {
    todos: []
  },

  getters: enhancedGetters({
    getTodoById: (state, getters) => (id) => {
      return state.todos.find(todo => todo.id === id)
    }
  }),

  // ...
}
```

## License

MIT

---
_Source: https://npm.io/package/vuex-strong-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
