Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promises are not supported #14

Open
mohamed-abdul-fattah opened this issue Dec 1, 2017 · 5 comments
Open

Promises are not supported #14

mohamed-abdul-fattah opened this issue Dec 1, 2017 · 5 comments

Comments

@mohamed-abdul-fattah
Copy link

I tried to run this code, it only runs the first line then nothing...

console.log('1st line');
const promise1 = new Promise((resolve, reject) => {
  resolve('Promise1 resolved');
});
promise1.then((result, err) => {
  console.log(result);
});
console.log('last line');

Note: it works fine on chrome.

@fntneves
Copy link

fntneves commented Mar 4, 2018

I also can't execute this code, even on Chrome.

My intention is to play with setTimeout and Promises. This is a very interesting educational tool!

@splincode
Copy link

Works, but not show in task queue

Promise.resolve({ then: function() {
    console.log('promise');
}});

@AdamDemirel
Copy link

Following code not running:

pr = new Promise(function(resolve, reject) {
    setTimeout(() => reject('bzzz'), 5000);
});

pr.then(
    result => alert(result),
    error => alert(error)
);

@latentflip
Copy link
Owner

Promises are not properly supported no. They should run but will not be visualised correctly.

@G-Rath
Copy link

G-Rath commented Jun 7, 2019

@latentflip would be required to support them? I've not actually been able to get Promises running at all.

I'm interested in doing a little lighting talk at my work about the event loop, and would love to use this to show off some things, so ideally if possible I'd love to get async/await & Promises working.

async/await is obviously a whole other kettle of fish,m and I don't entirely know if it'd be possible, but it'd be great if I could get promises at least somewhat working.

Are there any pointers you could provide? The code is very old, so it's proving rather hard to even find where things are happening, and hence anything info you could provide would be a boon :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants