- From: Domenic Denicola <domenic@domenicdenicola.com>
- Date: Thu, 11 Apr 2013 23:57:26 +0000
- To: Brandon Wallace <brandon.wallace@yahoo.com>, Tab Atkins Jr. <jackalmage@gmail.com>, "www-dom@w3.org" <www-dom@w3.org>
Hi all, The conventional name for these two methods would be Future.resolve and Future.reject. The implementation would be Future.resolve = (x) => new Future(({ resolve }) => resolve(x)); Future.reject = (reason) => new Future(({ reject }) => reject(reason)); This has the added benefit of using "resolve" semantics, i.e. assimilating thenables (including existing promises on the web, like jQuery promises).
Received on Thursday, 11 April 2013 23:58:16 UTC