Ben Aston
Ben Aston

Reputation: 55729

Instantiate a resolved promise in ES2015

What is the canonical way to create a resolved promise in ES 2015?

Upvotes: 51

Views: 7072

Answers (1)

Yotam Ofek
Yotam Ofek

Reputation: 2408

The Promise.resolve class method returns a promise that is instantiated as resolved with a value you can specify:

var promise = Promise.resolve(100);

Upvotes: 66

Related Questions