Last active
March 9, 2019 21:14
-
-
Save ritikesh/491126719a81242984c3ebdc53e668e8 to your computer and use it in GitHub Desktop.
Sample memoize_until usage snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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