Skip to content

Instantly share code, notes, and snippets.

@stagas
Created August 23, 2011 10:52
Show Gist options
  • Save stagas/1164841 to your computer and use it in GitHub Desktop.
Save stagas/1164841 to your computer and use it in GitHub Desktop.
recursive memoize
var express = require('express')
, memoize = require('memoize')
, cache = require('chaos')('cache')
, Beatport = require('beatport')
memoize.set('debug', true)
var bp = memoize('beatport-mem', memoize('beatport', Beatport({ perPage: 10, sortBy: 'releaseDate desc' }), {
expire: 1000 * 60 * 60 * 24
, store: cache
}), {
expire: 1000 * 60 * 60
})
, artists = memoize('artists', cache.mount('artists'), { expire: 1000 * 60 * 60, exclude: [ 'set' ] })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment