Skip to content

Instantly share code, notes, and snippets.

@ritikesh
Last active March 9, 2019 21:14
Show Gist options
  • Save ritikesh/491126719a81242984c3ebdc53e668e8 to your computer and use it in GitHub Desktop.
Save ritikesh/491126719a81242984c3ebdc53e668e8 to your computer and use it in GitHub Desktop.
Sample memoize_until usage snippets
const redis = require('redis');
const redis_client = redis.createClient();
const MemoizeUntil = require('memoize_until').MemoizeUntil
MemoizeUntil.init({
min: ['api_key']
})
MemoizeUntil.fetch('min', 'api_key', () => {
redis_client.get('api_limit_key', (err, val) => val );
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment