From 776f617ece5d333fe70df903982a18d65fc2776a Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 3 May 2015 17:22:20 +0100 Subject: Search completion; make completion lookup asynchronous. --- lib/utils.coffee | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/utils.coffee b/lib/utils.coffee index 5d9696e1..07528714 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -183,6 +183,12 @@ Utils = return true if re.test string false + # Convenience wrapper for setTimeout (with the arguments around the other way). + setTimeout: (ms, func) -> setTimeout func, ms + + # Like Nodejs's nextTick. + nextTick: (func) -> @setTimeout 0, func + # This creates a new function out of an existing function, where the new function takes fewer arguments. This # allows us to pass around functions instead of functions + a partial list of arguments. -- cgit v1.2.3