From 41495d11e6608767dde299223f10c8a606d4a8fb Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 2 May 2015 12:14:16 +0100 Subject: Search completion; minor tweaks. Including: - Make completers classes. That way, we may be able to get better code reuse. --- lib/utils.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/utils.coffee') diff --git a/lib/utils.coffee b/lib/utils.coffee index 338e535d..88fe9e2c 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -202,7 +202,8 @@ class SimpleCache constructor: (@expiry = 60 * 60 * 1000, @entries = 1000) -> @cache = {} @previous = {} - setInterval (=> @rotate()), @expiry + rotate = => @rotate() + setInterval rotate, @expiry rotate: -> @previous = @cache @@ -212,7 +213,6 @@ class SimpleCache (key of @cache) or key of @previous get: (key) -> - console.log "get", key if key of @cache @cache[key] else if key of @previous -- cgit v1.2.3