Skip to content

Instantly share code, notes, and snippets.

@rimian
Last active February 6, 2019 00:19
Show Gist options
  • Save rimian/7c38c990255d425e565b1f09ef819c8c to your computer and use it in GitHub Desktop.
Save rimian/7c38c990255d425e565b1f09ef819c8c to your computer and use it in GitHub Desktop.
Promises
stubPromise = () => new Em.RSVP.Promise(() => {});
promise_1 = Em.RSVP.defer({ promise: stubPromise() });
promise_2 = Em.RSVP.defer({ promise: stubPromise() });
promise_1.promise.then(() => console.warn(1, moment().valueOf()));
promise_2.promise.then(() => console.warn(2, moment().valueOf()));
moment().valueOf(); promise_1.resolve(); promise_2.resolve();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment