0.0.22 • Published 6 years ago

@plexis/cache v0.0.22

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

@plexis/cache

A caching mechanism for string operations.

npm i @plexis/cache

Usage

import cache from '@plexis/cache';

const toLower = x => x.toLowerCase();
const toLowerCache = cache(toLower);

// We are adding a dummy resolver function which returns the same cache every single time
const toLowerCacheWithResolver = cache(toLower, x => 'a');

toLowerCache('A'); // returns a;
toLowerCache('B'); // returns b;

toLowerCacheWithResolver('A'); // returns a;
toLowerCacheWithResolver('B'); // returns a !!;

Aliases

import cache from '@plexis/cache';
import {cache, memoize} from 'plexis';
0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago