Conjuring JQuery Deferred with monadic incantations
问题 Inspired by this (excellent) discussion of using Promises in javascript, I'm trying to work out how I could use Deferred to chain together async and non-async functions, to avoid paying the callback tax when using my 'Global storage' code. I've got a few questions related to this, but I'll ask them together here, because the context is the same. One thing I can't work out is how I can make a deferred out of something that isn't asynchronous - that is, how do I take a value, wrap it in a